Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 14th, 2004, 03:44 PM
Registered User
 
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB to start connection

I am in need of a vb script or small app that will run at start up of a computer. The script or app should automatically run a vpn connection I have set up and map drives I have established. I really don't know where to start. Any help greatly appreciated.
Thanks
Todd

Reply With Quote
  #2 (permalink)  
Old October 27th, 2004, 08:01 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Start by saving your script to C:\Windows\System

Then put a line in your Registry at:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run RunScript, REG_SZ, "C:\Windows\System\YourScript.vbs"

This will run your script at start up. You may need to put this in your pc image, or you can lay down this registry key with a login script.

I am not sure about invoking the vpn connection.

Do you want to map drives on the other side of this connection?

Mapping a drive F: for example is:

Set objNetwork = WScript.CreateObject("WScript.Network")
   objNetwork.MapNetworkDrive "F:", "\\ServerName\ShareName"

I am not sure if the vpn connection will mess this up. Can you tell me more about the steps you use to make the connection manually?

mmcdonal
Reply With Quote
  #3 (permalink)  
Old November 1st, 2004, 10:22 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Sorry, that's:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run \RunScript, REG_SZ, "C:\Windows\System\YourScript.vbs"

Please note the "\" added between Run and RunScript



mmcdonal
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Programming in VB.NET reality_42000 VB.NET 2002/2003 Basics 2 October 18th, 2006 05:40 AM
VB Connection from Excel button Danielle VB How-To 1 January 10th, 2006 09:11 AM
Connection pooling in VB vijayma VB How-To 0 March 18th, 2005 03:51 AM
Cant start the debugger vb.net local or remote? humour General .NET 0 September 6th, 2004 09:34 AM
Connection String with VB and Java 12th_Man Classic ASP Databases 2 July 18th, 2003 10:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.