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.
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."
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
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)
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...
"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.
"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;
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.
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.
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.
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