| 1. |
Solve : compair a black space to a string? |
|
Answer» Hi, if /i %Lastfile%==" " That tests if the string Lastfile is one space, not an empty stringQuote from: Dias de verano on February 21, 2008, 04:48:05 AM Quote from: blastman on February 21, 2008, 02:26:53 AMif /i %Lastfile%==" " would the other example work for an empty string then?? Quote from: blastman on February 21, 2008, 05:18:27 AM Quote from: Dias de verano on February 21, 2008, 04:48:05 AMQuote from: blastman on February 21, 2008, 02:26:53 AMif /i %Lastfile%==" " In an IF test, you need to enclose BOTH strings in quotes if /i "%Lastfile%"=="" (set lastfile="No Update Avaiable") and available has a letter 'l'. here try to set it up like dis set /p Lastfile=What is the name of the file u are LOOKING for? asks for ^ the name of the file if not %Lastfile% exists set %Lastfile%="No Update Avaible"(may not have proper spelling) echo %Lastfile% ^looks for the specifed file and the if the file doesnt exist the it says "No Update Avaible"Quote from: macdad- on February 21, 2008, 05:52:36 AM here try to set it up like dis I am afraid this is nonsense Dias de verano, You sir, are a star!! thanks for all your help over the last few days. Couldn't of DONE it without you. Cheers. |
|