Computing.Net > Forums > Disk Operating System > batch file gives syntax errors

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

Reply to Message Icon

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%

pause



Sponsored Link
Ads by Google

Response Number 1
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

Related Posts

See More



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?”


0

Sponsored Link
Ads by Google
Reply to Message Icon

Need with DOS Command PC-Tools 8.0 disk labels



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: batch file gives syntax errors

Help!! Batch File www.computing.net/answers/dos/help-batch-file/13525.html

Batch compiler www.computing.net/answers/dos/batch-compiler/12969.html

Batch file - using %1 www.computing.net/answers/dos/batch-file-using-1/12462.html