Another batch file permissions problem


  1. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
       #1

    Another batch file permissions problem


    Just recently there was a batch file permissions problem posted here. I'm also trying to run a command window, but my problem is a bit different.

    I have a batch file that cleans out programs' cache before shutting down the system, that I use every night to sign off. Since I demoted my normal user account from Admin, I'm incurring a permissions problem. The batch will fire, but only after I give it the UAC OK. That's as expected.

    I'd like to eliminate the need for the UAC OK for this program. But whether I give ownership of the Batch file to the super-admin or to my user account, the Run as administrator option on the Properties/Compatibility tab is grayed out. There simply seems to be no way to give this program residual admin rights.

    I'd like to be able to crack this nut, not just for this program but in order to learn more about how permissions work.

    Thanks,
    p.
      My Computer


  2. Posts : 5,642
    Windows 10 Pro (x64)
       #2

    Use Task Scheduler to run the batch file using a higher privileged account when you log off.
    Or have it run when you log on.
      My Computer


  3. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
    Thread Starter
       #3

    Thanks, but there are a couple of problems with that.

    • I can't find the way to tie an event to Shutdown. Maybe it's done via Event IDs?
    • Second, I don't really want to tie my batch to Shutdown, shutdown is already tied to the batch. I don't fire the batch every time I shutdown.
    • I'd rather not fire the batch on startup, when I'm already waiting for the machine to be available.
    • Finally, I'd like to know what's going on with this permissions problem, as it doesn't seem to me to be logical.

    p.
      My Computer


  4. Posts : 6,285
    Windows 10 Pro X64
       #4
      My Computer


  5. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
    Thread Starter
       #5

    Thanks. I remember seeing that post. Regarding this problem, I have tried it at the shortcut level too (which is how I fire the batch), and the option is grayed out there as well. I have UAC active, set to the third notch, or "normal" setting, so are you sure about that part of your post?

    p.
      My Computer


  6. Posts : 6,285
    Windows 10 Pro X64
       #6

    Well, apparently it doesn't always work that way. I just tried it myself and it was till grayed out, but ... found this and it does work.

    If you are accessing the properties of a shortcut, then you click the
    "advanced..." button on the shortcut tab, and there is a checkbox there "Run
    as administrator" that you use to make the shortcut to always ask for your
    permission when you double-click on it.

    Now I get the UAC prompt when I double click on the batch file link. Not what you were looking for but it does then run as Administrator.
      My Computer


  7. Posts : 1,025
    Linux Lite 3.2 x64; Windows 7, 8.1
    Thread Starter
       #7

    Yes, I failed to include that that was the first thing I had done. It's easy to get lost in the permissions labyrinth. I do get the UAC query, and once I OK it I can run the batch. But so far there's no way to give a batch file residual admin rights.

    Thanks,
    p.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:33.
Find Us