Les tests conditionnels avec des batchs sont merdiques à souhait, voici par exempel comment tester la présence de fichiers (dans le cas présent dans le répertoire courant) :
Code :
- rem ##########################################################################
- rem Check that all files are available into current directory
- rem ##########################################################################
- IF NOT EXIST .\instsrv.exe GOTO SRC1
- IF NOT EXIST .\srvany.exe GOTO SRC2
- IF NOT EXIST .\SETI@home.exe GOTO SRC3
- IF NOT EXIST .\user_info.sah GOTO SRC4
- IF NOT EXIST .\sah2k.reg GOTO SRC5
- IF NOT EXIST .\sahxp.reg GOTO SRC6
- IF NOT EXIST .\sah2kmps.reg GOTO SRC7
- IF NOT EXIST .\sahxpmps.reg GOTO SRC8
|
Si tu cherche vraiment un langage de script pour plateforme Windows, je te conseille de t'orienter vers Windows Scripting Host, c'est bcp plus souple que les batchs :
- http://msdn.microsoft.com/scripting/
- http://www.microsoft.com/technet/c [...] fault.mspx