Shortcut to Batch File Issue

Page 2 of 4 FirstFirst 1234 LastLast

  1. Posts : 526
    Windows 10 (22H2)
    Thread Starter
       #11

    dalchina said:
    I am now just wondering if there's a difference between running this as a standard user compared with an admin account.
    Are you logged in as admin?
    no, but I suppose you will now suggest that I do so? I'll give it a go and report back.
      My Computer


  2. Posts : 42,922
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #12

    Worth trying.. but the script is set to run as elevated anyway. And that's a difference..
      My Computers


  3. Posts : 526
    Windows 10 (22H2)
    Thread Starter
       #13

    ok - switching the login account to admin allowed the Option One dialogue to open and work. However, once created, executing the shortcut did not function whatsoever. It looks correct in the Task Scheduler. I would try Option Two, but I am assuming it is nothing more than a manual procedure of Option One, correct? Another thing, do I have to be in that admin account for it to work? Perhaps these UAC bypass tutorials are only for apps? If not ...

    ... fwiw, The problem code in this batch file seems to be a specific 'taskkill' command I added, as the code has other taskkill commands and executed just fine w/o UAC interference before the add.
      My Computer


  4. Posts : 6,827
    22H2 64 Bit Pro
       #14

    The way I do it:

    Create batch file.

    Create a shortcut to the batch file.

    Run the shortcut elevated.

    Instead of:
    Create Elevated Shortcut without UAC prompt in Windows 10

    I use a portable app to create elevated shortcuts. You can use the method in the tutorial but you have to use the task name that you created.

    Anyway for what it's worth here's screenshots of a shortcut to a batch file to run Cccleaner (custom batch file to import reg files every Ccleaner launch) and run it elevated so no UAC prompt.

    The batch file and reg files that it imports:

    Shortcut to Batch File Issue-ccleaner-batch-file.jpg

    The elevated shorcut to the batch file (note.lnk extension)

    Shortcut to Batch File Issue-ccleaner-batch-file-shortcut-properties.jpg

    The portable app used to create the shortcut. It's no longer available but the same capability is built into WinAero Tweaker.

    Shortcut to Batch File Issue-ccleeaner-batch-file-elevated.jpg

    EDIT: Ive changed the icon for Ccleaner batch file shortcut from the default icon and replaced it with the icon from Ccleaner.
      My Computer


  5. Posts : 526
    Windows 10 (22H2)
    Thread Starter
       #15

    Callender said:
    ... You can use the method in the tutorial but you have to use the task name that you created. ...
    did and did, hence post #13
      My Computer


  6. Posts : 6,827
    22H2 64 Bit Pro
       #16

    Post the contents of the batch file. Maybe someone might spot an issue with it.

    Also if you happen to have WinAero Tweaker installed try using it's elevated shortcut tool.
      My Computer


  7. Posts : 6,827
    22H2 64 Bit Pro
       #17

    Don't know if it helps but here's how it looks for in in Task Scheduler.

    Shortcut to Batch File Issue-cleaner-batch-file.jpg

    Shortcut to Batch File Issue-cleaner-batch-file-2.jpg
      My Computer


  8. Posts : 526
    Windows 10 (22H2)
    Thread Starter
       #18

    The problem command (there are other identical taskkill commands with different exe's) in the batch file is :

    taskkill /im Atom.SDK.WindowsService.exe /t /f

    when executed in a admin cmd window it runs fine. when I added it to the batch file, at first the command echoed "ERROR access denied". So I then began to tweak the shortcut and batch file with full permissions and run as administrator etc. and finally got it to work. However, I get the UAC with it. I can live with this, but I prefer not to.
      My Computer


  9. Posts : 6,827
    22H2 64 Bit Pro
       #19

    Try adding RUNAS before the first target line in your script.
    Or try changing shortcut properties advanced tab and check run as administrator box. (Or uncheck it if already checked)

    Or try;
    RUNAS taskkill /im Atom.SDK.WindowsService.exe /t /f

    Also what level is UAC set to? If set to max - try default.

    Other than that I don't have any ideas.
      My Computer


  10. Posts : 42,922
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #20

    As you're having such problems with the script, go for Option 2 in the tutorial. It's not actually that hard.
      My Computers


 

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

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




Windows 10 Forums