Anyone know how I can wait / sleep for x amount of ms in a vb script that I have defined for a rename script ?
I have tried
WScript.Sleep 10000
and :
Dim Wscript
Set WScript = CreateObject("WScript")
WScript.Sleep 10000
which results in ;
"ActiveX component can't create object: 'WScript'"
I dont want to have to do a for/next or do/while loop for obvious timing reasons.
On a side note, the reason for this has arrived from the following command :
strCommand = """" & DOpusRTPath & """ /cmd createfolder NAME=" & Chr(34) & strAppFolderName & Chr(34) & " READAUTO=yes"
Shell.Run strCommand,0,false
As part of the function later, it needs to obtain the parent path from the newly created folder, but when trying to obtain the parent path I get the error "Path not found". If I put in a MsgBox("Wait") to postpone the function, then when I press ok everything works, so it's obviously getting down the function's code BEFORE dopus has actually created the folder.
Also tried
Shell.Run strCommand,0,TRUE
To hopefully halt function execution until dopusrt.exe returns, and in theory the folder is created, but this doesnt seem to work either, so am left thinking the only way around it is to introduce a slight delay to allow DOPus to finish creating the folder.
Thanks.