command files and networking

  • Thread starter Thread starter doskei
  • Start date Start date
D

doskei

OK, so this question is probably answered elsewhere. Normally I think
I'd be able to solve it with the wealth of publicly available
information out there, but the difficulty here seems to be that there's
no way to search for this information efficiently without bringing up
tons of nonrelavent results.

So. The problem.
I'm trying to create a cmd file that launches on boot on my laptop,
which performs a series of commands that are location- (i.e. network-)
dependant. So when I'm at work, it connects to the office VPN (req'd
for wireless connectivity), then maps a number of work-related network
drives and and sets my homepage. When I'm at home it skips vpn
(automatically on wireless), connects to a number of network drives
provided by my little personal server, and sets my homepage.

The only thing I can't seem to do with this thing is launch the VPN.
I'm running XP pro SP2. The VPN is a pseudo-dialup connection in
Network connections. The trouble is, I don't know how to specify that
location in DOS ... in fact I'm rather guessing it might not be
possible. Creating a shortcut there and examining its properties just
gives me a huge text string that looks like a registry key from the
CLSID folder.

So I'm looking for anyone's thoughts. I would really like to be able
to launch a Windows XP network connection from a cmd file.
 
doskei said:
OK, so this question is probably answered elsewhere. Normally I think
I'd be able to solve it with the wealth of publicly available
information out there, but the difficulty here seems to be that there's
no way to search for this information efficiently without bringing up
tons of nonrelavent results.

So. The problem.
I'm trying to create a cmd file that launches on boot on my laptop,
which performs a series of commands that are location- (i.e. network-)
dependant. So when I'm at work, it connects to the office VPN (req'd
for wireless connectivity), then maps a number of work-related network
drives and and sets my homepage. When I'm at home it skips vpn
(automatically on wireless), connects to a number of network drives
provided by my little personal server, and sets my homepage.

The only thing I can't seem to do with this thing is launch the VPN.
I'm running XP pro SP2. The VPN is a pseudo-dialup connection in
Network connections. The trouble is, I don't know how to specify that
location in DOS ... in fact I'm rather guessing it might not be
possible. Creating a shortcut there and examining its properties just
gives me a huge text string that looks like a registry key from the
CLSID folder.

So I'm looking for anyone's thoughts. I would really like to be able
to launch a Windows XP network connection from a cmd file.

You could create a shortcut of your VPN icon on the desktop,
then invoke this shortcut in your batch file, e.g. like so:

@echo off
"%UserProfile%\Desktop\VPN.lnk"

Alternatively you could use this approach:
@echo off
"%AllUsersProfile%\Application
Data\Microsoft\Network\Connections\Pbk\Rasphone.pbk"
 
Pegasus (MVP) ~

Thank you sir! Somehow I knew if I posted on Groups I'd have an
answer in record time. You're a lifesaver, buddy.
I think I'm going to use the former of the two methods you offered,
because I can then set up my vpn to connect as soon as it's launched,
and I don't have to even click anything once the cmd file gets going.
The other one is a cool trick, though.
Anyway, thanks again.

- Jesse McNaughton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top