Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Second Request -- Value/Variable Q.

Original Message
Name: Marcus
Date: April 6, 2006 at 21:58:51 Pacific
Subject: Second Request -- Value/Variable Q.
OS: Plain DOS Syntax Question
CPU/Ram: Pentium 512Meg
Comment:
I posted this message earlier today, and it was removed from the forum for some unknown reason...

Is there something in this question which is inappropriate???

Here goes again...

I am trying to pass a value to a variable in DOS.

To wit:

SET NS6PATH=dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B

ECHO %NS6PATH%

echo y | del C:\WINDOWS\Applic~1\Mozilla\Profiles\default\%NS6PATH%\Cache\*.*

The purpose here is to empty the Netscape cache on my system quickly and easily; without having to know what the assigned folder is under a new install. I have had to reformat my system more than once over the eons, and take every possible opportunity to streamline the process and learn along the way.

However, I am incapable of elucidating the syntax which allows one to pass a string value produced by a command sequence such as "dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B" to a variable.

That’s it.

If anyone knows the answer to this fundamental DOS question, please let me know how this might be done; and, moderator, please be so kind as to allow this post to remain until answered.

Thank you.


Report Offensive Message For Removal


Response Number 1
Name: franki
Date: April 6, 2006 at 22:42:49 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
it was probably removed because you are using Windows and the command prompt within, ie Netscape is Windows Software. This forum is for Standalone DOS, as per the header:

"Below is the Disk Operating System message area. This forum is for all Standalone versions of DOS, not the "DOS" prompt contained inside later versions of Windows."


Report Offensive Follow Up For Removal

Response Number 2
Name: jboy
Date: April 6, 2006 at 23:10:51 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
This is the standalone DOS forum - questions related to 'Windows' DOS etc are sometimes removed, although the standard for doing so has become rather unclear.

There is a kind of explanation at the top of the forum page - the programming or specific Windows forum can often be a better option.

The value assigned to your variable does not seem appropriate to its placement


echo y | del C:\WINDOWS\Applic~1\Mozilla\Profiles\default\%NS6PATH%\Cache\*.*


becomes


echo y | del C:\WINDOWS\Applic~1\Mozilla\Profiles\default\dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B\Cache\*.*

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true


Report Offensive Follow Up For Removal

Response Number 3
Name: Mechanix2Go
Date: April 7, 2006 at 01:46:10 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
As jboy says, you don't want "dir c:\ blahblah" in the variable.

Seems like you're using this:

"dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B"

to figure out where the cache is.

Study the batch below and tinker with the ATTRIB line so that it puts out JUST ONE line.

::== marcus.bat
@echo off


:: You need to tailor the line below to suit your directory structure.
attrib /d /s c:\cache|find "Profiles">profiles

> m.d echo e 100 65 63 68 6F 20 79 7C 64 65 6C 20
>> m.d echo n del-it
>> m.d echo rcx
>> m.d echo b
>> m.d echo w
>> m.d echo q

debug < m.d > nul

copy /b del-it+profiles delcache.bat > nul

delcache
:: DONE


If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal

Response Number 4
Name: Marcus
Date: April 7, 2006 at 08:57:11 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
@franki:

I am aware that this is a "Standalone DOS" forum -- the question is about plain DOS syntax; hence the post.


@jboy:

Thank you for your thoughts.

I was aware of the string assignment issue; was able to sort that out during execution with the "ECHO %NS6PATH%" statement.

My question surrounded the extraction of the dir string value from "dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B". This line DOES yield forth the neat desired string value when executed. I simply want to grind that value into the "SET NS6PATH" statement.


@Mechanix2Go:

Thank you for the post. I'll tinker around with your syntax and see what floats to the surface :o)

Thanks again.

-Marcus


Report Offensive Follow Up For Removal

Response Number 5
Name: Marcus
Date: April 7, 2006 at 11:39:44 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
@Mechanix2Go:

Thanks again for the work which you did here.

I messed around with the attrib line to try and get the whole thing to crank over; but I wasn't able get anywhere.

Unfortunately, my first post (which was deleted by someone) had significantly greater detail of the problem which I face here. I think that the solution is much simpler than it might presently appear.

When Netscape 6 installs afresh, it places a single default directory of some ad-hoc name at the end of the path "C:\WINDOWS\Applic~1\Mozilla\Profiles\default"; in other words, it will burp up a folder of the name "ahsadjh.slt" or somesuch and drop it in at "C:\WINDOWS\Applic~1\Mozilla\Profiles\default" so that the whole mess becomes "C:\WINDOWS\Applic~1\Mozilla\Profiles\default\ahsadjh.slt".

Now, inside this randomly named dir, "ahsadjh.slt", falls the rest of the pathway, "\Cache", within which all of the files reside that I want to quickly access and delete.

By running the command line "dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B", the system returns this ad-hoc directory name, "ahsadjh.slt", which gives me the string which I need to plug into the "NS6PATH" variable directly.

However, "SET NS6PATH=dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B" will not get the job done for me: All I want to do is simply take the string which the command "dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B" produces and grind that value into "NS6PATH" for the subsequent line to operate on:

"echo y | del C:\WINDOWS\Applic~1\Mozilla\Profiles\default\%NS6PATH%\Cache\*.*"

When %NS6PATH% contains the retrieved string ahsadjh.slt, the batch operates; and the files in the Cache dir are eliminated.

Sorry for any confusion which may have been caused by my foreshortened post after my original missive was pulled...


Report Offensive Follow Up For Removal


Response Number 6
Name: franki
Date: April 7, 2006 at 12:13:15 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
"I am aware that this is a "Standalone DOS" forum -- the question is about plain DOS syntax; hence the post."

It is still Windows 9x MS-DOS Prompt and not MS-DOS6 which was the last Retail version whichever way you look at it is not appropriate for this forum. MS-DOS 6 use 8.3 file names and not shortened ~tilde names.


Report Offensive Follow Up For Removal

Response Number 7
Name: Mechanix2Go
Date: April 7, 2006 at 19:48:57 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
Hi Marcus,

Replace my ATTRIB line with your DIR line.


=====================================
If at first you don't succeed, you're about average.

M2Go



Report Offensive Follow Up For Removal

Response Number 8
Name: Marcus
Date: April 9, 2006 at 09:24:05 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
@Mechanix2Go:

Thanks again :o)

I think I can work it through now . . .

Take care --


Report Offensive Follow Up For Removal

Response Number 9
Name: Dan Penny
Date: April 9, 2006 at 16:01:44 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
"It is still Windows 9x MS-DOS Prompt and not MS-DOS6 which was the last Retail version whichever way you look at it is not appropriate for this forum. MS-DOS 6 use 8.3 file names and not shortened ~tilde names."

Windows 9x MS-DOS Prompt is simply MSDOS 7.x. It is still MSDOS no matter which way you look at it. Windows 9x MSDOS (MSDOS 7.x) run in raw mode (no GUI) has 8.3 filename and the tildes structure as well.

You can "make" a MSDOS 7.x standalone machine if you want to, which will act basically the same as a MSDOS 6.x machine;

http://www.computing.net/dos/wwwboard/forum/15662.html

http://www.d-a-l.com/articles/library/35.html


It's a good day when you learn something


Report Offensive Follow Up For Removal

Response Number 10
Name: Mechanix2Go
Date: April 10, 2006 at 03:32:43 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
Hi Marcus,

Let us know how it comes out.

Hi Dan,

As ever, you-know-who [formerly know as you-know-who ,you-know-who ,you-know-who ,you-know-who ] is still grinding the same corn and doesn't "get" that nobody cares.

Most folks would rather get help than an earache.


If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal

Response Number 11
Name: Dan Penny
Date: April 10, 2006 at 09:46:41 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
Hi M2G,

Yeah, it's just statements like that (I feel) should be clarified for the original poster in case they (or anyone else reading the post for help) aren't aware of the facts.

Take care.

It's a good day when you learn something


Report Offensive Follow Up For Removal

Response Number 12
Name: Dan Penny
Date: April 10, 2006 at 12:45:13 Pacific
Subject: Second Request -- Value/Variable Q.
Reply: (edit)
Sigh. One more time. The poster is "trying to pass a value to a variable in DOS.

To wit:

SET NS6PATH=dir C:\WINDOWS\Applic~1\Mozilla\Profiles\default /A:D /B

ECHO %NS6PATH%

echo y | del C:\WINDOWS\Applic~1\Mozilla\Profiles\default\%NS6PATH%\Cache\*.*"

The 8.3 MSDOS structure is ~obviously~ being utilized. The end product of this scenario is performed in MSDOS. Whether it's launched from windows or not, it's still done in MSDOS. I agree that the question ~could have been~ posted, and answered, in the 9x forum. But it's still a MSDOS structure/operation which is being sought. MSDOS is MSDOS is MSDOS. The essence of the question is still MSDOS. Therefore, this forum is JUST as appropriate for an answer.

The question of; "is win9x really dos, or is dos 7.x really win9x" has been posed and debated many times with two obvious stands for both sides of the argument. A search of this and the 9x forums will show this. (You may have to delve into the archives somewhat, it's been that long in the works.)

I myself am of the proponent that 9x is a GUI built on dos 7.x. (Strip away the c:\windows\command directory and see how long 9x runs. Oh, and how does 9x start? Yes, with command.com, io.sys, and msdos.sys (which by default O/S load merely points to the GUI).

"You two are the pain in the arses not re-directing the posters and always have been!"

This statement implies that we may "know" each other.

The user name "franki" is new to me (which is why I posed the "who is" question to DAVEINCAPS in another topic.) I've been on these forums for a ~couple~ of years at least and I don't recall you. You seem to have a very short fuse.


It's a good day when you learn something


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Second Request -- Value/Variable Q.

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




acer 312T BIOS problem

K7 Turbo possible max fsb?

Pc anywher problem

WinFLP & OE/Outlook2003

Computer resets after a few minutes


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC