1

i have written following vbScript file to make several programs autostart with delay:

'Delay time 50 seconds
WScript.sleep 50000

Set WshShell = WScript.CreateObject("WScript.Shell")

'Google Trans
WshShell.Run "E:\prg\gDesktopTranslator_v1.0\gDesktopTranslator.exe"

 WScript.Sleep 2000

'Skype
cmd_1 =  chr(34) & "C:\Program Files\Skype\Phone\Skype.exe" & chr(34)
cmd_2 = "/nosplash /minimized"
skype_cmd =  cmd_1 & " " & cmd_2

WshShell.Run   skype_cmd, 1, True

Set WshShell = Nothing
WScript.Quit

But the problem is that after script executes, WScript file is still in memory :( I supposed WScript will be closed by WScript.Quit alt text

2 Answers 2

1

Use the Exec method instead of Run.

Example:

Dim WshShell, oExec
Set shShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("E:\prg\gDesktopTranslator_v1.0\gDesktopTranslator.exe")
Sign up to request clarification or add additional context in comments.

Comments

0

There is a 'W' missing in the Answer of YWE. I cannot comment, because my reputations are too less...

Second line should be:

Set WshShell = CreateObject("WScript.Shell")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.