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,925 of 42,547    |
|    FromTheRafters to JJ used his or her keyboard to    |
|    Re: Win10 network on/off toggle with adm    |
|    10 Feb 21 11:21:00    |
      From: erratic@nomail.afraid.org              JJ used his or her keyboard to write :              > You can check the %PROCESSOR_ARCHITECTURE% variable. Its value is `x86` if       > 32-bit, or `AMD64` if 64-bit; or `IA64` if Itanium 64-bit.              Thank you for answering my questions.       I apologize that my opening post was fraught with misconceptions on my part.              I must have misunderstood you in that I know that I have a 64-bit machine       %PROCESSOR_ARCHITECTURE% = 'AMD64'              I thought the batch script was "running as if it was 32-bit" versus "running       as if it was 64-bit" that you were telling me to look out for.              I must have misunderstood. My mistake.              >>> at>nul       >>       >> I don't understand how that command is supposed to eliminate the UAC prompt.       >> Besides, my "at.exe" ALWAYS returns "1" (whether the gateway is on or off).       >       > Oh, sorry. I forgot that the tool is deprecated in Windows 10.              So is the cacls deprecated that I was using!       Both return an error message.        The AT command has been deprecated. Please use schtasks.exe instead.        Cacls is now deprecated, please use Icacls.              > In this case,       > check the `%windir%\system32\config\journal` directory instead of       > `%windir%\system32\config\system` file. FYI, it's applicable for Vista to       > Windows 10.              I finally gave up and I now think what I asked for was impossible anyways.              I don't think I was clear enough that the goal was to run a batch script       *WITHOUT* popping up the UAC box which has to be manually clicked.              I had no problem running a batch script as a user which *ASKED* for the UAC       prompt. At this point, I give up as I think I was seeking a unicorn.              What works though is either running the batch script "as administrator"       or (better yet) clicking a shortcut which points to a scheduled task which       is set to run the script "with elevated permissions."              >> (2) The script runs with elevated privileges without popping up a UAC prompt       >       > No program can acquire elevated privileges (admin access) without triggering       > the UAC prompt. Unless that program alread has elevated privileges.              Thank you for confirming that is the problem which I found out the hard way!       That means I was asking for a unicorn (I didn't know it when I had asked).              The good news is the scheduled task runs "with elevated privileges."       I now have a pretty green/red on/off taskbar icon that turns on and off my       gateway.              It has the unexpected added advantage of protecting the VPN connection       should the VPN connection suddenly drop.              I'm told by wasbit there is a ready made program that performs this task        http://crystalrich.com/internetoff/exe/internetoffsetup_3-0-1.exe       But I couldn't get it to work for me when I tested it today.              --- 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