Someone suggested a while back that I should use VBscript shell to open programs in windows XP and set them in specific locations on the desktop with specific window sizes. However, I have never worked with vbscript before, and do not understand it at all. I'm pretty quick to pick things up though, and if I saw an example of a VBS startup script, I could adapt it for my needs. Can anyone point me to a working vbs script that starts a program in windows xp?
Using VBS to open a program in XP
Collapse
X
-
Hi, sure...Originally posted by Z1P2Someone suggested a while back that I should use VBscript shell to open programs in windows XP and set them in specific locations on the desktop with specific window sizes. However, I have never worked with vbscript before, and do not understand it at all. I'm pretty quick to pick things up though, and if I saw an example of a VBS startup script, I could adapt it for my needs. Can anyone point me to a working vbs script that starts a program in windows xp?
First of all, make sure the Shell command is in a Sub procedure, then just run it. Its quite simple,
Note that Shell will return a Double (a number), this number is your program ID.
[CODE=vb]Sub forZ1P2()
Dim a As Double
a = Shell("c:\windo ws\notepad.exe" , 1)
End Sub[/CODE]
now, you have notepath open, and 'a' has its ID.
well, i hope that helps. -
the second parameter of shell will set the windows size, i used the numeric value ('1'), but there are constants easier to remember.Originally posted by Z1P2I don't understand how that sets the specific window location and size on the desktop when the program is launched...
once you have the handler number ('a') you can easily work with it.Comment
Comment