If exist doesn't work
|
Original Message
|
Name: solano
Date: May 31, 2008 at 12:02:21 Pacific
Subject: If exist doesn't workOS: dosCPU/Ram: 4gbModel/Manufacturer: amd |
Comment: echo off if exist C:\Documents and Settings\solano\Bureau\file.xlsx goto MESSAGE echo The file C:\Documents and Settings\solano\Bureau\file.xlsx doesn't exist Pause goto END MESSAGE echo The file C:\Documents and Settings\solano\Bureau\file.xlsx exists Pause :END
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: DosX
Date: May 31, 2008 at 16:27:40 Pacific
|
Reply: (edit)The filename has got spaces. Try to put it in quotes i.e.: @echo off if exist "C:\Documents and Settings\solano\Bureau\file.xlsx" goto MESSAGE echo The file C:\Documents and Settings\solano\Bureau\file.xlsx doesn't exist Pause goto END :MESSAGE echo The file C:\Documents and Settings\solano\Bureau\file.xlsx exists Pause :END BTW, you forgot to put ":" before MESSAGE label.
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: Bicephale
Date: June 3, 2008 at 09:50:04 Pacific
|
Reply: (edit)Full path FileNames of the form "C:\Documents and Settings\" are implying that this is a Windows console problem and hence you're not posting in the proper forum. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Salutations,Michel Samson a/s Bicéphale
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: mavis007
Date: June 4, 2008 at 10:44:54 Pacific
|
Reply: (edit)IF EXIST c:\path\filename.ext goto lable1 IF NOT EXIST c:\path\filename.ext goto lable2 :LABLE1 echo filename exists goto lable3 :LABLE2 echo filename does not exist goto lable4 :LABLE3 pause :: type commands here goto exit :LABLE4 pause :: type commands here goto exit :EXIT Grrrr wat do I know? ... got brain freeze
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: