I hope anyone could help me, thanks B-)
-or-
wshShell.AppActivate("Command Prompt");
wshShell.SendKeys("% N");
In the second example; there is a space between the % and the letter N.
Austin M. Horst
The first generates the error "invalid procedure call or arguments"
The second works like my procedure, the character N is sent to the
command prompt window and of course the window is not minimized.
I also tryed the combination of both solutions:
wshShell.SendKeys("%( )N");
but it works the same way.
still hoping... ;-)
Austin M. Horst <anon...@discussions.microsoft.com> wrote in message news:<A5DCBF14-AFE2-4ECD...@microsoft.com>...
Hi
WSH's SendKeys method doesn't work very well against a
dos box/command prompt.
For a Sendkeys solution that will work for this scenario, you should
use AutoIt or AutoItX.
AutoIt/AutoItX is free and can be found here:
http://www.hiddensoft.com/AutoIt/
AutoItX is an ActiveX control version of AutoIt and can be used from a
vbscript.
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
You can also try this vbs:
dim wso: set wso = createObject("wScript.shell")
msgBox "Minimized:"
for i=1 to 4
wso.run "%comspec% /c " & "ECHO Hello", 2, true
next
msgBox "Maximized:"
for i=1 to 4
wso.run "%comspec% /c " & "ECHO Hello", 3, true
next
msgBox "Normal:"
for i=1 to 4
wso.run "%comspec% /c " & "ECHO Hello", 5, true
next
wso.run "%comspec% /K " & "ECHO Welcome to DOS", 3
set wso = nothing
VBSctipt:
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Run "cmd.exe"
WSHShell.AppActivate "Command Prompt"
WSHShell.SendKeys "% N"
JScript:
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("cmd.exe");
WshShell.AppActivate("Command Prompt");
WshShell.SendKeys("% N");
Austin M. Horst
I thanks you all, but for now I give up B-(
Austin M. Horst <anon...@discussions.microsoft.com> wrote in message news:<680E924A-0D63-48B9...@microsoft.com>...
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Run "cmd.exe"
wsh.sleep 1000 ' wait 1 second
WSHShell.AppActivate "Command Prompt"
WSHShell.SendKeys "% N"
Peter Nguyen
"Luigino Rossi" <sbor...@hotmail.com> wrote in message
news:a7d9f7ce.04031...@posting.google.com...
I tested the script on Windows XP and on Windows 2000 with a Script
Host version 5.6
Thanks anyway B-)
"Peter Nguyen" <pet...@adobe.com> wrote in message news:<%Pn5c.239$g07.1...@newshog.newsread.com>...