locked
Batch file fails when executed as shortcut RRS feed

  • Question

  • I run a simple batch file (that stops and starts a vmWare service) as Administrator. It works OK when run from the command line (DOS box).
    I made a shortcut to this batch file, but when I invoke it, it always fails with the message: "FAILED 5: Access denied".
    I run Windows 7 32bit Ultimate with SP1.

    Here is the batch file:

    @echo on
    sc stop VMAuthdService 
    sc config VMAuthdService start= disabled
    pause "Enter any key"
    sc config VMAuthdService start= auto
    pause "Done"

    and here is the error:

    C:\>sc stop VMAuthdService
    [SC] ControlService FAILED 5:

    Access is denied.

    C:\>sc config VMAuthdService start= disabled [SC] ChangeServiceConfig FAILED 5: Access is denied. C:\>pause "Enter any key" Press any key to continue . . . C:\>sc config VMAuthdService start= auto [SC] ChangeServiceConfig FAILED 5: Access is denied. C:\>pause "Done" Press any key to continue . . .

    It does not matter if I run with the option: "Run As Administrator" or in XP Compatibility mode.
    Any ideas?
    Thank you in advance.
    Mike Demetrius



    • Edited by MikeDem Thursday, July 25, 2013 8:51 PM
    Thursday, July 25, 2013 8:49 PM

Answers

  • Hi,

    I have make a test for your batch file. Actually it present "Failed 1060" because of there was no VMware installed on my macthine. but I also creat a shortcut for this file, it has the same result.

    PS: My account of my system is belongs to Administrators group.

    From your description, there is a permission problem with your account. you can try the method below for test.

    1. Right click the shortcut, Choose "Properties".

    2. Click "Advanced", then tip run as administrator.

    • Marked as answer by Juke Chou Friday, August 2, 2013 6:03 AM
    Friday, July 26, 2013 3:41 AM