Have you got any suggestions where my problem is?
Best regards,
Helmut Baum
"test.cmd":
--------------------------
setlocal
set pid=400
call activate_windows.vbs %pid%
endlocal
--------------------------
"activate_windows.vbs":
--------------------------
set wshshell = CreateObject("WScript.Shell")
set args = Wscript.Arguments
pid = args(0)
username = "tesuser"
password = "pw"
hoststring = "@test.host.com"
WshShell.AppActivate (pid)
wshshell.SendKeys(pid & "~")
wshshell.SendKeys(username & "~")
wshshell.SendKeys(password & "~")
wshshell.SendKeys(hoststring & "~")
--------------------------
The args returns a string, but AppActivate wantd integer
pid = args(0) 'string
pid = 400 'integer
pid = CInt(args(0)) ' integer
You can use MsgBox TypeName (pid) to verify this.
Regards,
Torgeir
Regards
Helmut
>.
>
I don't think you will find this tip in a book, but here is a couple of
books that I like:
Title: Windows Scripting Secrets
Author: Tobias Weltner
Publisher: Hungry Minds, Inc.
ISBN: 0764546848
Title: Vbscript in a Nutshell : A Desktop Quick Reference
Author: Paul Lomax, Matt Childs, Ron Petrusha
Publisher: O'Reilly & Associates
ISBN: 1565927206
Torgeir