VB Script problem with WinXP

  • Thread starter Thread starter Ross
  • Start date Start date
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}"
 
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"
 
Back
Top