Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,636 of 42,547    |
|    Todd to foxidrive    |
|    Re: run as administrator question    |
|    10 May 13 21:10:21    |
   
   From: Todd@invalid.invalid   
      
   On 05/10/2013 09:01 PM, foxidrive wrote:   
   > On 11/05/2013 10:56, Todd wrote:   
   >> Hi Guys,   
   >>   
   >> Currently in W7, if I want to run command from a   
   >> command prompt as "administrator", I have to go   
   >> to the start orb, type in "cmd" (no return) and   
   >> right click on the resulting "cmd" and "run as   
   >> administrator".   
   >>   
   >> I am trying to run the following test line as   
   >> administrator from a regular command prompt:   
   >>   
   >> runas /user:administrator regedit && notepad   
   >>   
   >> Problem: I have to go into "management", "users   
   >> and groups" and enable administrator and give him   
   >> a password. Then the user gets to see "Administrator"   
   >> all them time when he boots up. And, it is easier   
   >> just to go to the orb.   
   >>   
   >> Is there a way around this?   
   >>   
   >> Many thanks,   
   >> -T   
   >>   
   >   
   > I call this one admin.bat and it gives me an Admin cmd prompt in Win 8. You   
   may get a UAC prompt but I   
   > have that disabled.   
   >   
   >   
   > @echo off   
   > if not "%~1"=="" goto :start   
   > :getfile   
   > set "file=%temp%\%random%.file.vbs"   
   > if exist "%file%" goto :getfile   
   >   
   >> "%file%" echo Set UAC = CreateObject("Shell.Application")   
   >>> "%file%" echo UAC.ShellExecute "%~f0", "%cd%", "", "runas", 1   
   > start "" "%file%"   
   > goto :EOF   
   >   
   > :start   
   >   
   > cmd /k "cd /d "%*"&echo Admin:"   
      
      
   Hi Foxidrive,   
      
   I so don't understand. There is a double and a tripple   
   quote on the two %file% commands. I always disable UAC   
   too. So what would the command line be?   
      
   Confused,   
   -T   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca