Is the Sleep operation no longer used in VBscript?

Daniel’s answer is absolutely correct about context being the key here. Although you don’t have the WScript method available, you do have the full browser DOM, including the window.setTimeout method. With VBScript, the semantics of passing code to setTimeout are a little bit different than JavaScript, but it’s still possible: Sub button1_onclick() window.setTimeout GetRef(“Delayed”), 1000 … Read more

Creating and writing lines to a file

Set objFSO=CreateObject(“Scripting.FileSystemObject”) ‘ How to write file outFile=”c:\test\autorun.inf” Set objFile = objFSO.CreateTextFile(outFile,True) objFile.Write “test string” & vbCrLf objFile.Close ‘How to read a file strFile = “c:\test\file” Set objFile = objFS.OpenTextFile(strFile) Do Until objFile.AtEndOfStream strLine= objFile.ReadLine Wscript.Echo strLine Loop objFile.Close ‘to get file path without drive letter, assuming drive letters are c:, d:, etc strFile=”c:\test\file” s … Read more

insert a variable to cmd command

LabelName doesn’t need to be a shell object, as it’s just a string. Then concatenate the string onto the run command and you are done. Set oShell = WScript.CreateObject(“WScript.Shell”) Dim LabelName LabelName = InputBox(“Please Enter Label to check-out:”, _ “Create File”) oShell.run “cmd /K “”c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd.exe”” co -p bla:[email protected]:7777/bla/ -is … Read more