1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
Dim MyArray, logiciel, pass, fso, wshshell
Set ObjArg = WScript.Arguments
logiciel = ObjArg(I)
syntaxe = " la syntaxe est : {nomdulogicielcomplet}_{nversion}[sous version] /// nom du logiciel est limité a 10 caractères, le numéro de version doit être numérique et comporter 2 caractères"
MyArray = Split(Logiciel, "_", -1, 1)
if len(myarray(0)) > 10 then
wscript.echo "ERREUR!! DE SYNTAXE pour Nom de logiciel"
wscript.echo " "
wscript.echo " "
wscript.echo " "
wscript.echo syntaxe
install = 0
elseif len(myarray(1))>2 or not isnumeric(myarray(1)) or install then
wscript.echo "ERREUR!! DE SYNTAXE pour N° de version"
wscript.echo " "
wscript.echo " "
wscript.echo " "
wscript.echo syntaxe
install = 0
else
install=1
end if
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(logiciel)) Then
wscript.echo "le dossier existe"
install = 1
Else
wscript.echo "CE PROGRAMME N'EXISTE PAS "
install = 0
End If
if install then
Set WshShell = WScript.CreateObject("WScript.Shell")
curentfldr = wshshell.currentdirectory & logiciel
wscript.echo curentfldr & "\install.bat"
'LaVar = "cmd " & curentfldr & "\install.bat"
'wshshell.Run LaVar
'WshShell.Run curentfldr & "\install.bat"
Call Shell("cmd /c " & curentfldr & "\install.bat")
'Set WshShell = WScript.CreateObject("WScript.Shell")
'set wshsell.currentdirectory = wshshell.currentdirectory & "\" & logiciel
else
wscript.echo "ERREUR"
end if |
Partager