VB Script problem with WinXP

R

Ross

The following VB script (meant for Windows Scripting Host)
works perfectly in Windows 2000. It opens Notepad and then
opens the Save As window. However, in Windows XP, it
correctly opens Notepad but fails to open the Save As
window. Any suggestions.

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\windows\Notepad.exe"
WScript.Sleep 100
WshShell.AppActivate "Notepad"
WScript.Sleep 90
WshShell.SendKeys "^{S}"
 
T

Torgeir Bakken (MVP)

Ross said:
The following VB script (meant for Windows Scripting Host)
works perfectly in Windows 2000. It opens Notepad and then
opens the Save As window. However, in Windows XP, it
correctly opens Notepad but fails to open the Save As
window. Any suggestions.

(snip)
WshShell.SendKeys "^{S}"

Hi

Don't use brackets around S, and also use a lowercase S. This works on both
Win2k and WinXP:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%windir%\Notepad.exe"
WScript.Sleep 100
WshShell.AppActivate "Notepad"
WScript.Sleep 90
WshShell.SendKeys "^s"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top