Vb script - WScript.Sleep

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.

If you want to create a folder in VBScript, use FileSystemObject.CreateFolder. Then you don't have to guess how long it will take as it will be done synchronously, which in turn means the script won't go horribly wrong if it takes longer than expected one day.

(After creating the folder, you could then issue an asynchronous DOpusRT.exe command to ask Opus to navigate to the folder, if you want the READAUTO=yes behaviour.)

Good advice, thanks.

PS. Is there any way to call the dopusrt.exe asynchronously from within the vb script ? It's a bit difficult to explain but I really need it to be within the script as the script is a collection of common functions which are called from various places within opus.

dopusrt.exe is always asynchronous.

Did you mean synchronously? There's no way to do that. (dopusrt.exe itself won't wait for the command to finish, it just passes the command to Opus and then exits, so even waiting for dopusrt.exe to finish won't help.)