Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863

    Vista/XP Shortcut with "run-as" ?

    Anyone know how to create (or modify) a shortcut to enable the run-as administrator in vista or xp? (Programmatically, of course).


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  2. #2
    Join Date
    Apr 2008
    Posts
    3

    Ditto

    My shortcuts in Vista won't work unless the user clicks "Run as administrator". Is there any way to create such a shortcut with SetupFactory 7 ?

    Thanks,
    Paul.

  3. #3
    Join Date
    Jul 2001
    Location
    Harrisburg, PA , USA
    Posts
    114

    VBS script to RUNAS

    This is a vbs script that does the runas programically. I got it from the WSNAME instructions.

    fill in the user, Password and command varibles execute it.


    Code:
    Option Explicit
    
    Const USER               = "" UserName
    Const PASS               = "" Password
    Const WSNAME_COMMANDLINE = "" Command Line
    
    Dim fso         : Set fso = CreateObject("Scripting.FileSystemObject")
    Dim WSHShell    : Set WshShell = CreateObject("WScript.Shell")
    Dim WshNetwork  : Set WshNetwork = CreateObject("WScript.Network")
    Dim oDic        : Set oDic = CreateObject("Scripting.Dictionary")
    Dim objArgs     : Set objArgs = WScript.Arguments
    Dim oProcessEnv : Set oProcessEnv = WshShell.Environment("PROCESS")
    
    Dim sPathToRunAs, iReturnCode
    
    sPathToRunAs = oProcessEnv("SystemRoot")&"\System32\runas.exe"
    
    if Not fso.FileExists(sPathToRunAs) Then : WScript.Quit(1) 'Can't find RunAs
    
    iReturnCode=WshShell.Run("runas /user:" & USER & " " & CHR(34) & WSNAME_COMMANDLINE & CHR(34), 2, FALSE)
    Wscript.Sleep 40                  ' Time for window to open.
    WshShell.AppActivate(sPathToRunAs)' Activate the Window
    WSHShell.SendKeys PASS & "~"      ' Send the password

Similar Threads

  1. using the "Run As" command
    By ultraz57 in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-13-2006, 08:39 AM
  2. "RUN AS" permissions
    By AaronCooper in forum AutoPlay Media Studio 5.0
    Replies: 13
    Last Post: 07-22-2004, 03:21 PM
  3. HOWTO: Create a Shortcut to an Internet URL
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-29-2002, 02:07 PM
  4. HOWTO: Uninstall a Shortcut Created with Actions
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-25-2002, 09:50 AM
  5. HOWTO: Create a Shortcut on the Desktop
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-19-2002, 02:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts