home bbs files messages ]

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,639 of 42,547   
   Todd to foxidrive   
   Re: run as administrator question   
   11 May 13 18:13:16   
   
   From: Todd@invalid.invalid   
      
   On 05/10/2013 10:23 PM, foxidrive wrote:   
   > On 11/05/2013 14:10, Todd wrote:   
   >> On 05/10/2013 09:01 PM, foxidrive wrote:   
   >>> On 11/05/2013 10:56, Todd wrote:   
   >>>>   
   >>>> 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 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.   
   >>>   
   >   
   >> 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   
   >   
   > You quoted the message so there were more > characters.  But look here with   
   leading spaces.   
   >   
   >   
   >     @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:"   
      
   Okay, the "redirects" came out as quotes.  HTML quotes   
   to boot.  Now I see what is happening.   
      
   Still have no clue what is going on.  Is there a way   
   to take my example and put it into a single line?   
      
   Many thanks,   
   -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