OT: flaky DOS command

Been a _very_ long time since I've used batch files, but I looked thru some very old stuff and found a batch file with /S.

It's on a Win2K machine. I understand that more "modern" OS's have neutered a lot of batch file methods. I don't really know for sure, as I've converted most of my repetitious tasks to executables. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| Phoenix, Arizona  85048    Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson
Loading thread data ...

At DOS prompt, issuing RMDIR /S DIRECTORYNAME works, but the exact same command in a BATch file barfs with the error message Invalid switch /S". WTF?

Reply to
Robert Baer

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Maybe it should be /S /Q in the batch file? It eliminates the Y/N prompt.

Cheers

Reply to
Martin Riddle

Dunno, but the batch gurus all lurk in alt.msdos.batch

Reply to
who where

Well win2k is beyond EOL. TIme to upgrade. You people that run old unpatched operating systems end up being 'bots on the internet. Wait until April 2014 rolls around all those XP machines get pwned.

I think the "everything" program can do mass deletions.

Reply to
miso

Except a DOS window isn't DOS.

DOS for instance has direct control over hardware. Peek and poke IIRC. A DOS window is still subject to the nuances of the OS.

Reply to
miso

Maybe because i am in the CMD line of Win2K and the /S option has been neutered. Would be a PITA to make a program that logged to each and every folder,do a DEL *.* and maybe have to do that recursively if a folder had folder(s). Not difficult (done that before) but a pain.

Reply to
Robert Baer

Thanks

Reply to
Robert Baer

Who cares about the EOL. I have a desktop computer with Windows98, and Windows 2000 (dual boot). And a laptop computer with XP.

90% of the time, I'm using Windows98, because I like it best. It does everything I need, except some of my newer (large) USB external hard drives have no drivers and just wont work. That's when I have to boot to Win2000. My laptop is only used for WIFI when I travel. I dont care for XP, and I dont like those small keyboards and monitors on laptops for daily use.

MS just wants our money. I dont play their game. I just use what works and what I like. From what I've seen of Windows 7 and 8, I have no interest in their bloatware whatsoever, and my old computer would not run it anyhow. I wont buy a new computer when my old one works just fine.

Reply to
generic

Have you tried using DOSBOX? I use that on my Win7 machine for legacy programs, and batch files seem to work OK.

Also, you can write utilities in JScript and WScript that use the file system.

Here is an example called MakeDir.js

========================= ====================== //Option Explicit

//Const ForReading = 1, ForWriting = 2, ForAppending = 8;

var objFSO, objFldr, objSFldr, objFl, objStream, sFile, sPath, sExtension;

// Create the FileSystemObject objFSO = fso = new ActiveXObject("Scripting.FileSystemObject");

// The file you want the dir printed to... sFile = ".\\FileDir.txt";

// The folder you want a dir of... sPath = ".\\";

var True = 1; objStream = objFSO.OpenTextFile(sFile, 2, True);

// Get the folder objFldr = objFSO.GetFolder(sPath); //21

fc = new Enumerator(objFldr.files);

for (; !fc.atEnd(); fc.moveNext()) objStream.WriteLine ( fso.GetFileName(fc.item()) );

objStream.Close();

========================= ====================

I made a larger script that copies various source and project files to a

directory for version control and archiving. But I haven't done anything

with it lately.

Paul

Reply to
P E Schoen

Yep. I forgot about "Quiet" ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| Phoenix, Arizona  85048    Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

Just tried both of your scenarios in a DOS windows under XP, worked fine both times (I used /S /Q however)...

Chris.

Reply to
chris.hoffmann

Maybe you missed the subtlety of my comment. I didn't say "DOS batch gurus". I said "batch gurus" Those guys handle batch stuff in DOS windows as much as pure DOS.

Reply to
who where

MS went to the PowerShell years ago. I suppose there are people who mess with the DOS "window", but I sure wouldn't trust them.

Reply to
miso

Just don't go on the internet and you will be fine. Oh wait......And of course open wifi is a sterile environment.

Reply to
miso

I use DOSBOX, but for 16 bit code. I don't think that is the issue here. But it is a good program.

Reply to
miso

"PowerShell"? it has been years since i heard that term.

Reply to
Robert Baer

Yeah, like 6 or 7 years. But it still exists.

Windows is not a static platform in the sense of linux. That is, a lot of old stuff still works on linux (except for the dreaded "deprecations."). Microsoft keeps changing stuff for the sake of changing stuff. I don't like to automate much on windows because I'm not sure what I do now will be good in the future.

Reply to
miso

Mine is essentially static; still using Win2K.

Reply to
Robert Baer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.