1.

Solve : Test a Folder not file?

Answer»

Hi

I Need test a Folders, for install a Software. in a batch file

I need compare in Windows, the languaje Spanish or English

Spanish your folder is c:\Archivos de programa\Program_Software
English your folder is  c:\PROGRAM files\Program_Software

In Windows, If I Write Star => Run => %ProgramFiles%,  Windows redirect Whith compare Idioms. and Windows DISPLAY Program Files, but in DOS is wrong directory o not found
in dos is c:\Archiv~1 or c:\progra~1

I have been doing is

If exist c:\archiv~1 goto
Install  Software in
c:\archiv~1\  (c:\Archivos de Programa\)
Program Software.
~
~
~
Else
Install Software in
c:\Progra~1 (c:\Program files)
~
~
~
end

here is the trouble, in dos unkonown the command ELSE and END :-?

 

HELP PLease


 If exist c:\archiv~1 (Install  whatever
         ) else (
                   do something else
)

should work at cmd
hope it helps
uliYou can have multiple lines in your if between the ().  One important thing to remember is that the ELSE has to be on the same line is the PREVIOUS close parenthesis.

So, to expand on the reply by uli_glueck:
CODE: [Select]If exist c:\archiv~1 (
   c:\archiv~1\setup.exe /params
   c:\cleanup.bat
   c:\whatever
) else (
   echo C:\Archivos de Programa does not exist
   echo No need to install software
)
ok, Works !

Yeaahh !!!


I Write the Incorrect paramets  

Thanks

Very Thanks!



Discussion

No Comment Found