A Windows 98 & ME forum. Win98banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Win98banter forum » Windows ME » General
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

Need DOS help



 
 
Thread Tools Display Modes
  #1  
Old March 5th 07, 03:37 AM posted to microsoft.public.windowsme.general
Fred S *****
External Usenet User
 
Posts: 16
Default Need DOS help

Hi folks,

I'm writing a batch file and need to check for the presence of a folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred
  #2  
Old March 5th 07, 03:55 AM posted to microsoft.public.windowsme.general
Fred S *****
External Usenet User
 
Posts: 16
Default Need DOS help

I did not provide a good example in the first post so here's another
that I've tested on both WinXP and WinME
-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------
Once again, using;

WinXP, I get "The Folder was Found"

WinME, I get "There is no folder"

and, of course there is a c:\fss folder

Hope this helps,

Fred

Fred S ***** wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred

  #3  
Old March 5th 07, 10:30 AM posted to microsoft.public.windowsme.general
shep
External Usenet User
 
Posts: 28
Default Need DOS help

Check your colons and other typos fred.


"Fred S *****" "Fred wrote in message
...
I did not provide a good example in the first post so here's another
that I've tested on both WinXP and WinME
-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------
Once again, using;

WinXP, I get "The Folder was Found"

WinME, I get "There is no folder"

and, of course there is a c:\fss folder

Hope this helps,

Fred

Fred S ***** wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred



  #4  
Old March 5th 07, 11:04 AM posted to microsoft.public.windowsme.general
Mart
External Usenet User
 
Posts: 1,190
Default Need DOS help

It's not that simple, shep,

Same thing happens on my WinMe and XP boxes. The syntax is certainly
correct, according to the help file in the oldmsdos (v6.22) folder - on the
WinMe CD.

Other than WinMe's (virtual) DOS is different to Real Mode DOS, so far, I
can't think of an explanation.

Mart


"shep" wrote in message
...
Check your colons and other typos fred.


"Fred S *****" "Fred wrote in message
...
I did not provide a good example in the first post so here's another
that I've tested on both WinXP and WinME
-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------
Once again, using;

WinXP, I get "The Folder was Found"

WinME, I get "There is no folder"

and, of course there is a c:\fss folder

Hope this helps,

Fred

Fred S ***** wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a
folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred





  #5  
Old March 5th 07, 10:06 PM posted to microsoft.public.windowsme.general
Tim Jackson
External Usenet User
 
Posts: 1
Default Need DOS help

"Fred S *****" "Fred wrote in message
...
I did not provide a good example in the first post so here's another
that I've tested on both WinXP and WinME
-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------
Once again, using;

WinXP, I get "The Folder was Found"

WinME, I get "There is no folder"

and, of course there is a c:\fss folder

Hope this helps,

Fred

Fred S ***** wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred


Try using the NUL filename, as show in the following example;

-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS\NUL GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------


  #6  
Old March 6th 07, 12:40 AM posted to microsoft.public.windowsme.general
Mart
External Usenet User
 
Posts: 1,190
Default Need DOS help

Neat one Tim!

Perhaps if I'd spent a little more time reading the help page properly, I
would have sussed it g

Odd though, that '\NUL' isn't needed for XP

Mart


"Tim Jackson" wrote in message
...
"Fred S *****" "Fred wrote in message
...
I did not provide a good example in the first post so here's another
that I've tested on both WinXP and WinME
-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------
Once again, using;

WinXP, I get "The Folder was Found"

WinME, I get "There is no folder"

and, of course there is a c:\fss folder

Hope this helps,

Fred

Fred S ***** wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a
folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred


Try using the NUL filename, as show in the following example;

-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS\NUL GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------




  #7  
Old March 6th 07, 03:20 AM posted to microsoft.public.windowsme.general
Fred S *****
External Usenet User
 
Posts: 16
Default Need DOS help



Tim Jackson wrote:
"Fred S *****" "Fred wrote in message
...
I did not provide a good example in the first post so here's another
that I've tested on both WinXP and WinME
-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------
Once again, using;

WinXP, I get "The Folder was Found"

WinME, I get "There is no folder"

and, of course there is a c:\fss folder

Hope this helps,

Fred

Fred S ***** wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a folder.
I find that the "IF EXIST ...." syntax only works for text in WinME.

I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
:START
RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

:END
ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

ONE
EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to jump
to one or more places in the batch file for other actions?

Thanks, Fred


Try using the NUL filename, as show in the following example;

-------------------------
@ECHO OFF
REM folder Bat
C:
IF EXIST C:\FSS\NUL GOTO :YES

:NO
ECHO ~
ECHO THERE IS NO FOLDER
PAUSE
GOTO :END

:YES
ECHO ~
ECHO THE FOLDER WAS FOUND
PAUSE

:END
------------------------


Hi Tim,

Thanks for that, I'll give it a try.

Fred
  #8  
Old March 27th 07, 01:57 AM posted to microsoft.public.windowsme.general
Shane
External Usenet User
 
Posts: 480
Default Need DOS help

Check out Prof Timo Salmi's collections of examples:
http://garbo.uwasa.fi/pc/ts.html There's one for batch in DOS (tsbat) and
one for NT (tscmd). You are likely to find at least some of it
indispensible.


Shane

Fred S *****" "Fred S wrote:
Hi folks,

I'm writing a batch file and need to check for the presence of a
folder. I find that the "IF EXIST ...." syntax only works for text in
WinME.
I can use this in WinXP but NOT in ME

IF EXIST C:\TEST GOTO END
START

RENAME C:\START\SAMPLE.TXT JONES.TXT
GOTO DONE

END

ERASE C:\TEST\XXXX.TXT YYYY.TXT
GOTO DONE

DONE

EXIT

Running this batch file in WinXP works fine but in WinME it does NOT
follow the directions. It simply drops to the next line after the IF
EXIST statement.

Same thing happens if I use IF NOT EXIST - just goes to the nest line.

Can someone advise on how to check if a folder is there and how to
jump to one or more places in the batch file for other actions?

Thanks, Fred



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Win98banter.
The comments are property of their posters.