I am using the windows openvpn GUI client to autorun a bat file to mount a network drive upon a successful connection. However, the BAT file does not actually mount the drive after executing via the open vpn gu,i but it will successfully mount it if run via windows explorer. What do I need to change to allow this to happen properly? I am running windows 8.1 if that helps!
The name is matching my config file with an _up suffix. Here is the contents of the bat file:
net use Y: \\IP\groupwork password /user:username /persistent:no
I attempted to run it in the client config using the following command string, with the corresponding BAT file:
script-security 2
route-up route-up.bat
This appeared to do nothing, so I reverted back to the previous method. Is it a permission issue that could be causing this? I am open to whatever solution, I am not sold on any particular method! Thanks for any help.
Windows BAT File to Auto Mount Drive
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 1
- Joined: Sun Aug 30, 2015 1:10 am
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: Windows BAT File to Auto Mount Drive
OpenVPN does not allow this kind of function ..
All called scripts must complete before the VPN is made available.
All called scripts must complete before the VPN is made available.
-
- OpenVpn Newbie
- Posts: 16
- Joined: Tue Jul 23, 2013 1:16 pm
Re: Windows BAT File to Auto Mount Drive
For me it's working in the way you wish:
- you don't have to put this line "route-up route-up.bat" in your config - only the bat-file is needed
- you have to name it "route_up.bat" not "route-up.bat" (if yout config is named "route.ovpn")
Mathias
- you don't have to put this line "route-up route-up.bat" in your config - only the bat-file is needed
- you have to name it "route_up.bat" not "route-up.bat" (if yout config is named "route.ovpn")
Mathias
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: Windows BAT File to Auto Mount Drive
It may work if you set /persistent:yes ..