Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

batch start programs and hit enter in windows 7

I have 4 programs I frequently open when I'm doing development. I didn't feel like actually doing some development one evening so I wrote this script:

test.bat

start /d "C:\eclipse" eclipse.exe
start /d "C:\Program Files (x86)\Pidgin" pidgin.exe
start /d "C:\wamp" wampmanager.exe
start /wait /d "E:\websites\scripts" tunnelier.vbs

tunnelier.vbs

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run """C:\Program Files (x86)\Bitvise Tunnelier\Tunnelier.exe"""
WshShell.AppActivate "Tunnelier"

WshShell.SendKeys "{ENTER}"

and I'm finding that it successfully opens all of the programs, but there are two problems.

  1. The enter key is not being sent while tunnelier is the active window (it doesn't login.) If I just run tunnelier.vbs it works fine, but in the batch file it doesn't work.
  2. wampmanager.exe must have an odd manifest file because windows is giving me that annoying and long-winded "do you want to allow the following program from an unknown publisher to make changes to your computer" prompt.

So my question is twofold;

  1. How can I make the enter key register in the proper window?
  2. How can I get rid of the unknown publisher UAC prompt?

I've tried to research both topics and have failed, so any help is very appreciated!

like image 591
Alex Waters Avatar asked Feb 23 '26 02:02

Alex Waters


1 Answers

  • You don't need to send enter key. Start the Tunnelier specifying -profile and -loginOnStartup, this also means you don't need VBScript script anymore.

C:\Program Files (x86)\Bitvise Tunnelier\Tunnelier.exe -profile=profile_file.path -loginOnStartup

Also check out : http://www.bitvise.com/files/tunnelier-params.txt

  • To get rid of UAC for wampmanager, you can use Runas. It prompts password for every call but not with /savecred parameter, however you have to enter the password for once.

Finally, your script could be something like that:

start /d "C:\eclipse" eclipse.exe
start /d "C:\Program Files (x86)\Pidgin" pidgin.exe
start runas /profile /savecred /user:Administrator "c:\wamp\wampmanager.exe"
start /d "C:\Program Files (x86)\Bitvise Tunnelier" Tunnelier.exe -profile=profile_file.path -loginOnStartup
like image 152
Kul-Tigin Avatar answered Feb 25 '26 18:02

Kul-Tigin