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 42,045 of 42,547   
   Zaidy036 to John Robertson   
   Re: Change the right click context menu    
   04 Jul 22 12:33:13   
   
   XPost: alt.comp.os.windows-10   
   From: Eric@Bloch.com   
      
   On 7/3/2022 10:56 PM, John Robertson wrote:   
   > On 2022/07/03 7:42 pm, Zaidy036 wrote:   
   >   
   >   
   >> One way to always run as Admin would be to start the batch with:   
   >>   
   >> If %1=a goto xxxx   
   >> SCHTASKS /RUN /TN    at highest privileges and add argument a.   
   >> :xxxx   
   >   
   > If I can get this to work that will be beautiful as then I won't NEED   
   > that damn context menu to run each of a hundred different batch files as   
   > admin!   
   >   
   > Currently I select all hundred (after editing the registry to allow   
   > that), and then, I right click once to "run as admin" and then I hit the   
   > "YES" button time and again until all are done.   
   >   
   > If I could put inside each batch file one line like that which didn't   
   > need me to ALSO create a scheduled task of elevated privileges, that   
   > would be great.   
   >   
   > Does your method above REQUIRE a scheduled task for EACH of the hundred   
   > batch files or can I just put that one line in each of the hundred batch   
   > files?   
   >   
   Not sure if it will work but maybe set a variable instead of a fixed   
   TASKNAME. Also may need to kill bat before SCHTASKS   
      
   have not tried but maybe something like:   
      
   New Batch: _RunAdmin.bat:   
   TIMEOUT /t 1 > NUL   
   %_BN% a   
      
   Start of Batch to RUN:   
   If %1=a goto xxxx   
   SETx _BN    
   SCHTASKS /RUN /TN _RunAdmin   
   exit   
   :xxxx   
      
   --- 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