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 41,918 of 42,547   
   JJ to FromTheRafters   
   Re: Win10 network on/off toggle with adm   
   08 Feb 21 14:09:19   
   
   From: jj4public@gmail.com   
      
   On Sun, 7 Feb 2021 23:11:59 -0500, FromTheRafters wrote:   
   > Zaidy & I are working on a Windows 10 network on/off toggle switch   
   > but I'm not a programmer so I'm mixing & matching from what I can find.   
   >  Newsgroups: alt.comp.os.windows-10   
   >  Subject: Re: A Taskbar shortcut to turn off/on (toggle) the Internet   
   connection?   
   >  Date: Mon, 1 Feb 2021 10:51:51 -0500   
   >  Message-ID:    
   [snip]   
      
   The problem is because of how the admin access detection is done.   
      
   In that code, the detection checks the accessibility of below system file.   
      
     %SYSTEMROOT%\system32\config\system   
      
   However, that file is only accessible for 64-bit programs. 32-bit programs   
   only see the 32-bit version Windows system directory - which is at:   
      
     %SYSTEMROOT%\syswow64\config\   
      
   In that directory, there is no file at all. Only subdirectories.   
      
   The system transparently maps "%SYSTEMROOT%\system32\" to   
   "%SYSTEMROOT%\syswow64\".   
      
   So a different, bitness independent admin access detection method needs to   
   be used. I suggest executing the priviledged AT program like this.   
      
     at>nul   
     if errorlevel 1 (   
       rem no admin accesss yet. do self elevation   
       goto :eof   
     )   
     rem already got admin access   
      
   Executing the AT program would be slower, but it works for both 32-bit and   
   64-bit programs, because Windows has both 32-bit and 64-bit versions of the   
   AT program.   
      
   --- 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