UAC, batch files, and automation

daddysmurf

New Member
Hi all, first of many posts, I'm sure. Here goes :)

My company installs our software on about 50 computers a day. Included with that install is a remote-login software. In order for everything to work properly, we have to make a user, elevate that user to administrator, hide the user, and set power settings correctly. In xp, this is no problem, and up until now, we've required our clients have 2000 or xp. As vista is now over a year old, we're adding support for it too.

My problem is that the batch file I've written to handle adding a user and setting the computer properly requires administrative rights (see 'add user'). Everything I've read says something along the lines of 'right click, run as administrator' or 'to turn off uac, do this.' These are not options for me. The people installing this software are usually about computer savy as my grandmother, so I can't have them performing extra steps beyond 'click here. this pops up. click here. this happens. click here.' I'm ok with with boxes popping up asking for permission, but I can't assume they'll understand right-click.

I need to know how to raise my permission level from the command line. I need to be able to do this on any computer, no matter the computer name, administrator name, etc.

Thanks for any help you can provide.



found my answer here:
Run Commands Elevated In Batch Scripts - Vista
 
Last edited:

My Computer

I just saw this post because I haven't been online all day - but the link that that post links to is what I would have referred you to anyway.

Another option is to install Start++, a nifty little tool written by a M$ programmer specifically to enhance Vista's Start Menu. The reason being is that Start++ incorporates a sudo command that is, by default, allowed in all contexts, meaning it can be run from a CMD window as well as from the Start menu.

Another solution which I just ran into last week is a *really* nifty one, and it might help you out in the long run, as even the elevate command stills gives a UAC prompt: How to launch a program always elevated under Vista UAC - that is, by far, the best tip I have seen in a long time - the reason being is that you can export those Task Scheduler items and roll them out, assuming you use a standardized admin account and password....that would probably save you a lot of time and effort in the long run, eh?

HTH
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro X64 Insider Preview (Skip Ahead) latest build
    Manufacturer/Model
    The Beast Model V (homebrew)
    CPU
    Intel Core i7 965 EE @ 3.6 GHz
    Motherboard
    eVGA X58 Classified 3 (141-GT-E770-A1)
    Memory
    3 * Mushkin 998981 Redline Enhanced triple channel DDR3 4 GB CL7 DDR3 1600 MHz (PC3-12800)
    Graphics Card(s)
    eVGA GeForce GTX 970 SSC ACX 2.0 (04G-P4-3979-KB)
    Sound Card
    Realtek HD Audio (onboard)
    Monitor(s) Displays
    2 * Lenovo LT2323pwA Widescreeen
    Screen Resolution
    2 * 1920 x 1080
    Hard Drives
    SanDisk Ultra SDSSDHII-960G-G25 960 GB SATA III SSD (System)
    Crucial MX100 CT256MX100SSD1 256GB SATA III SSD (User Tree)
    2 * Seagate Barracuda 7200.12 ST31000528AS 1TB 7200 RPM SATA II Mech. HD
    Seagate ST1500DL001-9VT15L Barracuda 7200.12 1.5 TB S
    PSU
    Thermaltake Black Widow TX TR2 850W 80+ Bronze Semi-Mod ATX
    Case
    ThermalTake Level 10 GT (Black)
    Cooling
    Corsair H100 (CPU, dual 140 mm fans on radiator) + Air (2 *
    Keyboard
    Logitech G15 (gen 2)
    Mouse
    Logitech MX Master (shared)
    Internet Speed
    AT&T Lightspeed Gigabit duplex
  • Operating System
    Sabayon Linux (current, weekly updates, 5.1.x kernel)
    Manufacturer/Model
    Lenovo ThinkPad E545
    CPU
    AMD A6-5350M APU
    Motherboard
    Lenovo
    Memory
    8 GB
    Graphics card(s)
    Radeon HD (Embedded)
    Sound Card
    Conextant 20671 SmartAudio HD
    Monitor(s) Displays
    Lenovo 15" Matte
    Screen Resolution
    1680 * 1050
    Hard Drives
    INTEL Cherryvill 520 Series SSDSC2CW180A 180 GB SSD
    PSU
    Lenovo
    Case
    Lenovo
    Cooling
    Lenovo
    Mouse
    Logitech MX Master (shared) | Synaptics TouchPad
    Keyboard
    Lenovo
    Internet Speed
    AT&T LightSpeed Gigabit Duplex
I could see that being useful for some of my in-office deployments, and I have about 6 test boxes in my office, so at least useful for me. As far as elevate requiring a click, I'm fine with that. My clients can usually handle a click here command, but walking them through right-click>run as admin would take an hour and half. Thank you much :)

btw, I like the handle in your pic, I have one just like it in my trunk... makes me think someone's gonna run away when I put em back there... better bring a bat to make sure...
 

My Computer

Yeah, users can *usually* handle the one click for allowing things - my personal problem is that they get too used to clicking Allow / OK / Continue and don't pay attention to *what* is asking for privileges. Hence, my utter surprise when I saw that this method works *without* prompting them at all - and that means that if they *do* get a prompt, they will (hopefully!) be more wary of it and start asking questions.

re: My avatar - my normal avatar is a beautifully rendered animated blue-flaming Quake symbol, but since I wasn't allowed to use that here I opted for this one - the first tie I saw this type of a handle in the trunk of a rental car I was delivering I broke down and laughed for a full minute. I immediately had to take a phone pic of it, and it has been on my MySpace account ever since. When I couldn't use the animated Quake symbol, this one took its place.
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro X64 Insider Preview (Skip Ahead) latest build
    Manufacturer/Model
    The Beast Model V (homebrew)
    CPU
    Intel Core i7 965 EE @ 3.6 GHz
    Motherboard
    eVGA X58 Classified 3 (141-GT-E770-A1)
    Memory
    3 * Mushkin 998981 Redline Enhanced triple channel DDR3 4 GB CL7 DDR3 1600 MHz (PC3-12800)
    Graphics Card(s)
    eVGA GeForce GTX 970 SSC ACX 2.0 (04G-P4-3979-KB)
    Sound Card
    Realtek HD Audio (onboard)
    Monitor(s) Displays
    2 * Lenovo LT2323pwA Widescreeen
    Screen Resolution
    2 * 1920 x 1080
    Hard Drives
    SanDisk Ultra SDSSDHII-960G-G25 960 GB SATA III SSD (System)
    Crucial MX100 CT256MX100SSD1 256GB SATA III SSD (User Tree)
    2 * Seagate Barracuda 7200.12 ST31000528AS 1TB 7200 RPM SATA II Mech. HD
    Seagate ST1500DL001-9VT15L Barracuda 7200.12 1.5 TB S
    PSU
    Thermaltake Black Widow TX TR2 850W 80+ Bronze Semi-Mod ATX
    Case
    ThermalTake Level 10 GT (Black)
    Cooling
    Corsair H100 (CPU, dual 140 mm fans on radiator) + Air (2 *
    Keyboard
    Logitech G15 (gen 2)
    Mouse
    Logitech MX Master (shared)
    Internet Speed
    AT&T Lightspeed Gigabit duplex
  • Operating System
    Sabayon Linux (current, weekly updates, 5.1.x kernel)
    Manufacturer/Model
    Lenovo ThinkPad E545
    CPU
    AMD A6-5350M APU
    Motherboard
    Lenovo
    Memory
    8 GB
    Graphics card(s)
    Radeon HD (Embedded)
    Sound Card
    Conextant 20671 SmartAudio HD
    Monitor(s) Displays
    Lenovo 15" Matte
    Screen Resolution
    1680 * 1050
    Hard Drives
    INTEL Cherryvill 520 Series SSDSC2CW180A 180 GB SSD
    PSU
    Lenovo
    Case
    Lenovo
    Cooling
    Lenovo
    Mouse
    Logitech MX Master (shared) | Synaptics TouchPad
    Keyboard
    Lenovo
    Internet Speed
    AT&T LightSpeed Gigabit Duplex
Back
Top