Vbs script temporisation

nlc -  
lermite222 Messages postés 8724 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

Besoin d'un petit coup de main, voici mon script vbs :

" info = get_OS_Bit()


Function get_OS_Bit()
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")

Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName
const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"
strValueName = "Identifier"


oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
if (instr(strValue,"x86")) then
Wscript.echo "OS running on : " & strComputer & " is 32 bit."
oFSO.CopyFolder "\\stockage\LOGICIELS\1-PREPA WIN7 x64","C:\Essai"

elseif (instr(strValue,"64")) then
Wscript.echo "OS running on : " & strComputer & " is 64 bit."
oFSO.CopyFolder "\\stockage\LOGICIELS\1-PREPA WIN7 x64","D:\Essai"

else
get_OS_Bit="NotSure"
wscript.echo "Not sure."
end if
End Function
"

Il marche très bien, ce qu'il fait, c'est qu'il détecte si Windows est en 64 ou 32 bits et copie le fichier placé sur le stockage réseau en conséquence. Ensuite, j'ai prévu la suite du code dans l'exécution des fichiers qui sont à l'intérieur du fichier déplacé. Petit problème, comment faire pour lancer mon exécution, une fois que tous les fichiers sont déplacés ? Une sorte de temporisation quoi ! Et également, pour l'éxécution des fichiers, comment je fais pour que l'éxecution se fasse quand le fichier d'avant est bien installé ..

Merci à vous d'avance ..
A voir également:

1 réponse

lermite222 Messages postés 8724 Date d'inscription   Statut Contributeur Dernière intervention   1 191
 
Bonjour,

Tu a essayé avec l'API SHELL ?
Je ne pense pas qu'il faut temporiser, la commande ne passera que quand le chargement sera complet mais là je suis pas certain.
A+
0