Techware Labs Header

Forums have moved

See this announcement for more details, or just go directly there.

  #1  
Old 10-05-2004, 03:33 AM
vee_ess's Avatar
vee_ess vee_ess is offline
Super Moderator
 
Join Date: Aug 2001
Location: Phoenix, Arizona
Posts: 2,781
Send a message via ICQ to vee_ess Send a message via AIM to vee_ess Send a message via MSN to vee_ess Send a message via Yahoo to vee_ess
Default Mapping network drives through commands

Ignore the subject; it's just the net use command. I have a VPN connection and several network drives to map each time the VPN is connected. I can have the network drives reconnect at logon, but that would require me to have enable the VPN to require logging on before the Windows logon can be accessed.

I do not want the VPN logon to come on at the Windows logon screen, except for a particular user, so I was hoping someone would be able to help me write custom logon scripts so that the VPN logon screen comes up when a particular user logs in, before their settings are loaded.

Since that's unlikely, I was hoping for another option which would allow the VPN logon come up through the startup folder (or registry equivalent) and then I can click on a shortcut (or script) to map all the drives. The only thing I can think of, (which works pretty well actually,) is a batch file with a series of net use commands. The problem I'm facing is that I don't want the drives to reconnect at logon and I don't know how to use the /persistent: no in a batch, because that needs to go on a new line.
Reply With Quote
  #2  
Old 10-05-2004, 07:09 AM
james
 
Posts: n/a
Default

ok, i'm a bit unclear on what you want.

1) You want automagic mapping of drives when connecting to a VPN connection?

2) You want one user to logon to the VPN when logging into Windows?
2a) You want that user to get automagic mapping of drives when connecting to the VPN as well.

A couple years ago I tried quite hard to get a startup script to run when connecting to a VPN with no luck.

On another note, I do not believe that /persistent: no needs a new line. I've used it all in one line in batch files without issue, and I believe it was working properly. At least, the users who said they were having issues with that stopped bitching about the hang up issues associated with windows' attempt to have persistent mapped drives connected. This shoudl work

Code:
net use X: \\server\share /PERSISTENT:NO
Reply With Quote
  #3  
Old 10-05-2004, 07:11 AM
james
 
Posts: n/a
Default

on another note, i have a script that maps drives on my laptop for my home network. Is there anyway I can get it to give me a prompt asking if I want it to continue or cancel the operation at the beginning of the script, and that would timeout after 30 seconds with an auto-yes. (even a prompt would be fine, but a <x> second timeout would be uber-cool)
Reply With Quote
  #4  
Old 10-05-2004, 02:51 PM
vee_ess's Avatar
vee_ess vee_ess is offline
Super Moderator
 
Join Date: Aug 2001
Location: Phoenix, Arizona
Posts: 2,781
Send a message via ICQ to vee_ess Send a message via AIM to vee_ess Send a message via MSN to vee_ess Send a message via Yahoo to vee_ess
Default

Thanks, James. I don't know why I had it stuck in my head that I had to have /PERSISTENT:no on a new line. It's working find for me now.

I'm not sure how you could get a timeout, but I know of a way to add a prompt. Use the Install Express program (IExpress.exe in the system32 folder). It's pretty self-explanatory so just go through it, the only options you really need to change are to add a confirmation prompt and run the batch file as the installation program.
(Create new SED > Extract and Run command > Prompt's Title > Make sure you use a prompt!!!! > don't use a license > add batch file > the rest is up to you...)
Reply With Quote
  #5  
Old 10-05-2004, 03:10 PM
Jason425 Jason425 is offline
Lab Master Techie
 
Join Date: Sep 2002
Location: The Matrix
Posts: 7,353
Send a message via AIM to Jason425 Send a message via Yahoo to Jason425
Default

omg I never heard of iexpress before, that's awesome!
__________________
Dell Inspiron 1420 in Midnight Blue - Intel Core2Duo T7300 2.0GHZ/4MB - 2GB Ram - Nvidia 8400 GS 128mb - DVD/RW - 160GB 7200RPM - 14.1" Antiglare - Intel 4965AGN - Bluetooth 2.0 - 2MP Webcam - Vista Home Premium
2005 Mazda3i in Strato Blue
http://www.jasondsmith.net

Reply With Quote
  #6  
Old 10-05-2004, 03:37 PM
vee_ess's Avatar
vee_ess vee_ess is offline
Super Moderator
 
Join Date: Aug 2001
Location: Phoenix, Arizona
Posts: 2,781
Send a message via ICQ to vee_ess Send a message via AIM to vee_ess Send a message via MSN to vee_ess Send a message via Yahoo to vee_ess
Default

IExpress is definately good stuff, it can help to automate so many things, especially when combined with batch files and commands.

I did forget about another useful tool, however, so you can prompt inside the batch file itself: the set and if commands. Here's an example of what you batch file would look like:
Code:
set /p answer=Would you like to map the drives [Y/N]?
if '%answer%'=='N' goto EOF
if '%answer%'=='n' goto EOF
net use i: \\server\share /persistent:no
net use j: \\server\share2 /persistent:no
:EOF
IExpress looks a lot more professional, however.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:06 AM. Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum style by ForumMonkeys.