UAC workaround possible?

energizerabby

New Member
I have been trying to figure this out for days and days.

I need to run a program from a batch file with administrator rights. I can run the batch file in 256 colors and all the other settings, but I can't run it as administrator.

So I made the cmd window with administrator rights, and I can run the batch file there and it works.

BUT, I want to automatically run the batch file. I tried to set it up as a scheduled task at startup, but I couldn't get it to work. I don't know if "administrator" means any account in Vista 64 that shows "administrator" or if it must be setup from the "Administrator" account, which I guess I would have to unhide and then access.

So, I have the nice VBScript program, and it will call the cmd window with administrator rights. But no more. Then I have to type the name of the batch file in. So is it possible for the VBScript program to call the cmd window either with the batch file name attached so it would run when the cmd window starts, or have the VBScript start the cmd window and then in the next step of the script send the batch file name to the cmd window. But I can't find any way to do this.

So hopefully one of the experts here can help. Thanks.
 

My Computer

Hi,

I am a bit confused as to what you are asking how to do, but here is how to do a few things:

1: Always Run a Batch File as an Administrator : Windows Vista and Windows 7 Help Then execute shortcut (from VBScript or whatever).

2: To run a batch file as the Administrator, from Command Prompt or shortcut (must type password each time, password must not be blank) use:

"runas /user:administrator test.bat"

3: To save the password. This is a 3rd party script and stores the password IN PLAIN TEXT. NOT secure. This may not work for Vista. I am currently trying to work out how to use this in Vista (it may not be possible) See here: Sanur, Commandline Runas Automation Utility for Window 2000/XP/2003

4: Have a look at this Scripting Guy post, but I don't think it will help much: Hey, Scripting Guy! Blog : How Can I Use the RunAs Command to Run a Script Under Alternate User Credentials?

If you are using a Domain System, then some of this will not apply. Once you have chosen exactly HOW you are going to achieve your aim, post back and I will help you with the scripting.

Richard
 

My Computer

System One

  • Manufacturer/Model
    Dell XPS 420
    CPU
    Intel Core 2 Quad Q9300 2.50GHz
    Motherboard
    Stock Dell 0TP406
    Memory
    4 gb (DDR2 800) 400MHz
    Graphics Card(s)
    ATI Radeon HD 3870 (512 MBytes)
    Sound Card
    Onboard
    Monitor(s) Displays
    1 x Dell 2007FP and 1 x (old) Sonic flat screen
    Screen Resolution
    1600 x 1200 and 1280 x 1204
    Hard Drives
    1 x 640Gb (SATA 300)
    Western Digital: WDC WD6400AAKS-75A7B0

    1 x 1Tb (SATA 600)
    Western Digital: Caviar Black, SATA 6GB/S, 64Mb cache, 8ms
    Western Digital: WDC WD1002FAEX-00Z3A0 ATA Device
    PSU
    Stock PSU - 375W
    Case
    Dell XPS 420
    Cooling
    Stock Fan
    Keyboard
    Dell Bluetooth
    Mouse
    Advent Optical ADE-WG01 (colour change light up)
    Internet Speed
    120 kb/s
    Other Info
    ASUS USB 3.0 5Gbps/SATA 6Gbps - PCI-Express Combo Controller Card (U3S6)
First, thank you so much niemiro for your attempts to help. It is greatly appreciated.

As a bit of further explanation, I can't make the batch file shortcut run as administrator, the little box is greyed out. And yes, the UAC is on and the little box is greyed out.

However, I've got the shortcut to the cmd box to run as administrator. So that would work out fine. And I can call the shortcut to the cmd box that runs as administrator. But that is where everything stops.

If I want to run the batch file, I can type it into the cmd box there and it runs fine, as the administrator priveledges. But I don't want to do the typing into the cmd box, I want the VBScript to automatically input it. I don't know if you can call the cmd shortcut with the name of the batch file and its parameters, or if after calling the cmd shortcut the VBScript can then send the batch file name and its parameters to the cmd box.

Also, if I could just run the VBScript at startup with the administrator priveledges that would be OK too, but I can't seem to do that. It asked for the password, I type in the only password for the entire computer, and it says it is the wrong password. But I really didn't want to be typing in a password either to run the program. I guess that there might be some way as niemiro mentioned, but I haven't tried that since I couldn't even get it to accept my password typing.
 

My Computer

Back
Top