Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch file gives syntax errors
Name: sudha_ilu Date: November 30, 2005 at 18:34:26 Pacific OS: dos 5.0 CPU/Ram: 512
Comment:
can any one please help me out. The following batch works in all windows version, but says error in dos 5.0
@Echo OFF
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v for /f "tokens=1" %%u in ('time /t') do set t=%%u if "%t:~1,1%"==":" set t=0%t% set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
for /f "delims=" %%x in ('dir *.RAT /b ') do RENAME %%x %%x_%timestr%
Name: wizard-fred Date: November 30, 2005 at 21:12:53 Pacific
Reply:
There is no guarantee that the command interpreter is backwards compatible. Especially from the newer window's version. "Works in all Windows versions." Did you try Win 3.1?
0
Response Number 2
Name: jboy Date: November 30, 2005 at 21:54:39 Pacific
Reply:
Is this really "DOS 5" or (more likely) Window XP/NT5??
Resist the temptation to close your request for help with semantically-null questions like “Can anyone help me?”
0
Response Number 3
Name: Mechanix2Go Date: November 30, 2005 at 22:58:47 Pacific
Reply:
Most sommand interpreters are backward compatible.
Few, if any, are forward compatible.
The is no for /f in DOS 5.
If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: jboy Date: November 30, 2005 at 23:57:14 Pacific
Reply:
That was where I was going with that, sure
(or in other words: DOS5 my... foot)
Resist the temptation to close your request for help with semantically-null questions like “Can anyone help me?”
0
Response Number 5
Name: Mechanix2Go Date: December 1, 2005 at 00:04:11 Pacific
Reply:
" works in all windows version"
I would be very surprised, maybe even flabbergasted, if that worked in w9x.
And I'll bet my little finger it won't work in w3x.
If at first you don't succeed, you're about average.
M2
0
Response Number 6
Name: plainandsimple Date: December 1, 2005 at 00:04:14 Pacific
Reply:
Do NT users really think we are that stupid not to release that never ever is it MS-DOS ?
0
Response Number 7
Name: Mechanix2Go Date: December 1, 2005 at 00:07:02 Pacific
Reply:
Maybe 'all windows versions' has taken on new meaning.
Maybe it now means XP home and XP pro.
If at first you don't succeed, you're about average.
M2
0
Response Number 8
Name: jboy Date: December 1, 2005 at 02:36:45 Pacific
Reply:
It is a sorry state of affairs: an entire generation of would be batchers who've likely never encountered an actual DOS prompt.
For the record - - Windows versions are not DOS versions (4, 5... whatever)
Resist the temptation to close your request for help with semantically-null questions like “Can anyone help me?”
Summary: I need help with writing a batch file that returns an error code to another application (app1). My batch file is called by another application, when my batch file runs, it calls a VBS Script. This scr...
Summary: I wrote a batch file to delete contents of Temporary Internet Files folder as well as C:\windows\temp folder and then auto closes its DOS window.Finally I compiled it using BatchCompiler_UK. The norm...
Summary: I am making batch file and need to know how to do the following if %1 = "debug" goto debug if %1 = "normal" goto normal At the moment I get syntax error It should be obvious what I am trying to do but...