(Msg. 1) Posted: Mon Dec 08, 2008 11:54 am
Post subject: If-then-else statement in a batch file Archived from groups: microsoft>public>win2000>file_system (more info?)
I'm running a batch file to unzip some pdf files, and print them. I don't
want the program to run if there isn't a zip file available. I'm trying to
run the following which only gives me a syntax error.
IF not EXIST
"P:\Pyrwin\Reports\shormans\Shorman_eob_print_jobs\processing\working\*.zip"
GOTO END
(Msg. 2) Posted: Mon Dec 08, 2008 11:15 pm
Post subject: Re: If-then-else statement in a batch file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
"joe vaughan" <joevaughan DeleteThis @discussions.microsoft.com> wrote in message
news:EFD908BB-0E2F-46EF-B196-43BA7105B758@microsoft.com...
> I'm running a batch file to unzip some pdf files, and print them. I don't
> want the program to run if there isn't a zip file available. I'm trying
> to
> run the following which only gives me a syntax error.
>
> IF not EXIST
> "P:\Pyrwin\Reports\shormans\Shorman_eob_print_jobs\processing\working\*.zip"
> GOTO END
>
> This isn't working. Any ideas?
If you put this all on one single line then it will work:
if not exist "P:\Pyr...\*.zip" goto :eof
Note the inbuilt :eof label, preceded by a colon.
(Msg. 3) Posted: Sat Dec 20, 2008 10:11 pm
Post subject: Re: If-then-else statement in a batch file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Pegasus (MVP) ´£¨ì:
> "joe vaughan" <joevaughan DeleteThis @discussions.microsoft.com> wrote in message
> news:EFD908BB-0E2F-46EF-B196-43BA7105B758@microsoft.com...
>> I'm running a batch file to unzip some pdf files, and print them. I don't
>> want the program to run if there isn't a zip file available. I'm trying
>> to
>> run the following which only gives me a syntax error.
>>
>> IF not EXIST
>> "P:\Pyrwin\Reports\shormans\Shorman_eob_print_jobs\processing\working\*.zip"
>> GOTO END
>>
>> This isn't working. Any ideas?
>
> If you put this all on one single line then it will work:
> if not exist "P:\Pyr...\*.zip" goto :eof
> Note the inbuilt :eof label, preceded by a colon.
>
>
by adding parentheses, multi lines could be use
if not exit FILENAME (
REM other actions
goto END
)
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum