GVC won't run script on connect
I'm using the global VPN client to connect to the office remotely. When I connect I need to flush dns and do a few other tasks like mounting drives and grabbing new copies of shared files. I've written a batch file to do this. The file works perfectly when run manually, but it does not run at all from the "run this command when connection is established" property in the VPN settings. I've tried it saved as a .bat and .cmd with no change in behavior. Does this option work at all, and do I need to do anything differently to make it work?
Best Answer
-
TKWITS Community Legend ✭✭✭✭✭
Have you tried running a simple exe with the option to test? Like notepad.exe or cmd.exe?
If that works you know the client is doing what it is supposed to but may not like your files, if not than maybe try a different version.
1
Answers
Yeah, that's it - it'll run an executable, but not a .bat file. This behaviour is broken. If you need to run a list of tasks on connect you shouldn't have to compile them into a program to run them, especially since windows can launch bat and cmd files natively.
It's not broken if it's behaving as intended. You can call a batch file as an argument when running cmd.exe with the /c or /k argument.
That's just a question of whether the design is broken or the implementation.
I did try cmd /c. It doesn't take command line parameters either. Apparently nothing other than a single path to a .exe will run.