Advertisement

04.13.2008 at 10:48AM PDT, ID: 23318742
[x]
Attachment Details

visual basic script - run as Administrator - NEED HELP FAST

Asked by manoire in Microsoft Visual Basic.Net

Tags: visual basic script, XP Pro SP2

I need help fast on this one.
I need to run an application as Administrator. The PC is running in a protected user account and I need to run an application behind the scenes as Administrator. So I tried it with a vb script, following.
I got message "Variable is wScript undefined". I am a rookie in VB.

'This script allows limited accounts to use KioskDeployer
'as the Administrator. It must be placed in the same
'folder with the executable program file for KioskDeployer. A shortcut
'to this script file can then be put on the Desktop.
'-------------------------------------------------------
Option explicit
dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "runas /user:Administrator ""c:\WalmartKiosk\KioskDeployer\KioskDeployer.exe"""
WScript.Sleep 100
'Replace the string yourpassword~ below with
'the password used on your system. Include tilde
oShell.Sendkeys "987654~"
Wscript.QuitStart Free Trial
 
Loading Advertisement...
 
[+][-]04.15.2008 at 02:26AM PDT, ID: 21357131

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: visual basic script, XP Pro SP2
Sign Up Now!
Solution Provided By: ericwong27
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628