Utilities & Scripts

Encrypted RunAs Network Control Tool (Win XP ONLY)

We have created a FREE utility for Windows XP called network.exe (save into c:\windows directory) that can enable/disable network connections and connect/disconnect dialup/ADSL/VPN connections, it requires admin rights so therefore it must be run with Encrypted RunAs.

The Syntax is:

For Network Connections

network.exe enable NamedConnection (blank for Local Area Connection)
network.exe disable NamedConnection (blank for Local Area Connection)
network.exe toggle NamedConnection (blank for Local Area Connection)

For Dialup/ADSL/VPN

network.exe connect DialUpConnectionName
network.exe disconnect DialUpconnectionName
network.exe toggledialup DialUpconnectionName

Example of Encrypted RunAs input is as follows:

(Network.exe is not an officially supported application, but please feel free to email any problems or comments and we will try to help)

Click here to download network.exe

Example network logon script to create desktop shortcuts

Requirements: This script Place code in a VBScript logon script, Domain License

Instructions:

  • Create a hidden share on a server (ie erunas$) and allow everyone to read.
  • Copy ERunAs.exe and the shortcut .eras file (both would be found in c:\windows by default.
  • Copy the script below into your logon script (VBS), or create a new script and copy the text in to test.
  • Change the variables strServer, strShare, strERAS and strProduct. to reflect the name and locations of your share.
Set WshShell = CreateObject("Wscript.Shell") ' Server Name
strServer = "WINGNUT"

' ERunAs Share
strShare = "erunas$"

' ERunAs .eras name
strERAS = "notepad.eras"

' Name you want  displayed under the shortcut Icon
strProduct = "Notepad"

' You can replace StartMenu with 'Desktop' or "StartMenu'
strLink = WshShell.SpecialFolders("Desktop") + "\" & strProduct & ".lnk"

Set WshShortcut = WshShell.CreateShortcut(strlink)
WshShortcut.Description = strproduct
WshShortcut.TargetPath = "\\" & strServer & "\" & strShare & "\ERunAs.exe"
WshShortcut.Arguments = "\\" & strServer & "\" & strShare & "\" & strERAS

WshShortcut.IconLocation ="\\" & strServer & "\" & strShare & "\ERunAs.exe, 0"
WshShortcut.WindowStyle = 1
WshShortcut.WorkingDirectory = "\\" & strServer & "\" & strShare
WshShortcut.Save

Click here to download example.vbs

Example Script to Deploy a Shortcut manually

This script allows you manually deploy a shortcut to another computer and create a windows shortcut
Requirements: USB Pen Drive, Floppy Disk or accessible Network Share. Domain License

Instructions:

  • Create the shortcut with either a Domain Account or select domain in Encrypted RunAs and type LOCALM in the domain textbox (this disables checking the shortcut is on same computer it was created on).
  • Click here to download the Deploy Shortcut.vbs script.
  • Open the file with notepad and edit the text highlighted in yellow below, save the result and exit notepad.
  • Copy ERunAs.exe and YourShortcut.eras (in c:\windows by default), and the Deploy Shortcut.vbs to either a USB Pen Drive, Floppy Disk or Network Share.
  • On the new computer, log in with an account with admin rights, locate and double click the file Deploy Shortcut.vbs on the USB Pen Drive, Floppy Disk or Network.
  • You should now have an Icon on the Desktop or StartMenu.
Set WshShell = CreateObject("Wscript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")

' Default File Location
strFileLocation = "c:\windows\"

' ERunAs .eras name
strERAS = "notepad.eras"

' Name you want displayed under the shortcut Icon
strProduct = "Notepad"

' Add the full path to the application containing the icon you wish to display
' ie c:\windows\notepad.exe, leave blank for default icon
strIconLocation = "c:\windows\notepad.exe"

'Copy the files from the current directory to the c:\windows
oFS.CopyFile "ERunAs.exe", strFileLocation
oFS.CopyFile strERAS, strFileLocation
Set oFS = Nothing

' You can replace StartMenu with 'Desktop' or "StartMenu'
strLink = WshShell.SpecialFolders("Desktop") + "\" & strProduct & ".lnk"

Set WshShortcut = WshShell.CreateShortcut(strlink)
WshShortcut.Description = strProduct
WshShortcut.TargetPath = strFileLocation & "ERunAs.exe"
WshShortcut.Arguments = strFileLocation & strERAS

'Only add icon if user specifies a path
if strIconLocation<>"" then
WshShortcut.IconLocation =strIconLocation
end if

WshShortcut.WindowStyle = 1
WshShortcut.WorkingDirectory = strFileLocation
WshShortcut.Save

msgbox "Finished"