Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Route Add command in login script

Posted on 2006-03-24
10
Medium Priority
?
5,410 Views
Last Modified: 2008-05-07
I have a login script that maps network drives and printers, can I add a standard command prompt that runs a ROUTE ADD command, or do I need to do it in another file and call the file to run in the vbs script?

Thanks!
Kevin
0
Comment
Question by:Kevin Smith
9 Comments
 
LVL 51

Expert Comment

by:Netman66
ID: 16279766
You should be able to run it directly from the script.

ROUTE ADD ..


0
 

Author Comment

by:Kevin Smith
ID: 16280013
Cool...also, is it better to do that from a script, or just make the command persistant on each workstation (upped the points by 25 for the added question?
0
 
LVL 3

Expert Comment

by:jbatt
ID: 16280201
You should be fine to add it to the logon Script.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:TheCleaner
ID: 16280291
What do you need an additional route in a workstation for?  Shouldn't your Layer 3 networking equipment be taking care of this?
0
 

Author Comment

by:Kevin Smith
ID: 16280364
My Firebox isn't accepting my routing table for some reason and time is an issue...I'm using the route add as a quick and dirty method of getting an application to work so it'll give me time to figure out the Firebox issue.
0
 
LVL 51

Expert Comment

by:Netman66
ID: 16280999
I wouldn't make it persistent, no.  It'll run each logon so that takes care of having it there each time.  At some point you will correct the switch problem and at that point rather than deleting persistent routes you simply have to remove the line from the script.

0
 

Author Comment

by:Kevin Smith
ID: 16283027
I get an error when I add it directly in the vbs script...??
0
 
LVL 51

Accepted Solution

by:
Netman66 earned 600 total points
ID: 16284215
You didn't mention it was VBScript.

You can't call it directly in VBScript since this a an External command from the scripting engine.

This snipit should do it.  Just change the details in the route.


Set objShell = WScript.CreateObject("WScript.Shell")
wscript.sleep 100
Set objExecObject = objShell.Exec("%comspec% /c route add 192.168.0.0 mask 255.255.255.0 0.10.10.10 ")


0
 
LVL 51

Expert Comment

by:Netman66
ID: 16284742
My apologies - you did mention VBScript and I missed that.

The above should sort you out.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question