locked
batch files will not run from Windows7 GUI RRS feed

  • Question

  • command files with extension bat or cmd will not run when clicked on for all users , even admins, and regardless of where the batch file is located. Took out the anti-virus and even did a system restore to a point prior to the AV installation.

    This problem does not relate to anything the batch file is doing. I created a simple batch file in the Desktop that does a dir followed by a prompt and it will not run either.

    The error window that pops up says "Windows cannot access the specified device, ports or file"

    I checked the security on \Windows\System32\cmd.exe and Users have read&execute and read rights.

    The batch file will not run if started from the Start menu - Run.

    The batch file will run if "Run As Admin" is used.

    The batch file will run if a regular command prompt is opened and run from within that.

    At this point I'm tempted to reinstall W7 but we do not have the installation disk :(  , so a proper resolution would be most helpful.

    Thanks.


    TechNet

    Tuesday, May 10, 2016 7:53 PM

Answers

  • Hi techSvcMgr_4_smb,

    According to your description, I suspect that your permission has problem or this is 3rd party security program related issue. I suggest that we could uninstall any 3rd party security program to check. Then please check the link below to follow the steps.

    Then we can try process monitor to fix the permission issue.

    Process Monitor v3.05

    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    Solving Access Denied Errors Using Process Monitor

    http://improve.dk/solving-access-denied-errors-using-process-monitor/

    Hope it will be helpful to you.


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, May 11, 2016 11:45 AM

All replies

  • Hi techSvcMgr_4_smb,

    According to your description, I suspect that your permission has problem or this is 3rd party security program related issue. I suggest that we could uninstall any 3rd party security program to check. Then please check the link below to follow the steps.

    Then we can try process monitor to fix the permission issue.

    Process Monitor v3.05

    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    Solving Access Denied Errors Using Process Monitor

    http://improve.dk/solving-access-denied-errors-using-process-monitor/

    Hope it will be helpful to you.


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, May 11, 2016 11:45 AM
  • Thanks, it led me to the problem.

    The COMSPEC variable had been changed by accident.


    TechNet

    Wednesday, May 11, 2016 7:30 PM