Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


run the net use command

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60579
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> run the net use command
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 run the net use command - 5/22/2008 5:25:23 AM   
  aschwartz

 

Posts: 12
Score: 0
Joined: 4/30/2008
Status: offline
Hi.  I am puzzled.  I am pretty new with VB and have a challenge.I need to have users in a specific group have their com ports mapped to a server when they are in a citrix session for a certain app they are using.

I am able to do this via the net use command, in this syntax:  net use com4: \\client\com1:

Running this on a session works, the net use results show that.  So I could stick that in a bat file and be done, but unfortunately it needs to be done for a specific group.  Normally I would use VB script and create a special script that ran only on this group, but I dont know how to run that command in VB.  To map a drive, I use the following logic

Case "Sales_Sec"
           WSHNetwork.RemoveNetworkDrive "L:", True, True   
           WScript.Sleep 350 '350 millsecond pause 
           WSHNetwork.MapNetworkDrive "L:", "\\server\Sales",True

So that the case is the AD group that is being given the L drive mapping

How can I use the same principals to run the net use command?
 
 
Post #: 1
 
 RE: run the net use command - 5/22/2008 5:37:45 AM   
  aschwartz

 

Posts: 12
Score: 0
Joined: 4/30/2008
Status: offline
I assume of course that this would involve the wshShell.Run command, but I am unsure of the syntax of how to word it.

(in reply to aschwartz)
 
 
Post #: 2
 
 RE: run the net use command - 5/22/2008 7:11:20 AM   
  dm_4ever


Posts: 2548
Score: 40
Joined: 6/29/2006
From: Orange County, California
Status: offline
.Run "%comspec% /c net use com4: \\client\com1"

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to aschwartz)
 
 
Post #: 3
 
 RE: run the net use command - 5/22/2008 7:41:38 AM   
  aschwartz

 

Posts: 12
Score: 0
Joined: 4/30/2008
Status: offline
Perfect.  Thank you very much.

(in reply to dm_4ever)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> run the net use command Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts