Windows 8 and 8.1 Forums


Problem with running batch file in certain directory

  1. #1


    Posts : 8
    Windows 8.1

    Problem with running batch file in certain directory


    Hi there

    There is a batch file that is to be runned from C:\ directory. It is going to install a driver. (The batch file with some other needed files are in a folder)
    Code:
    @devcon remove root\mcamvusb
    @devcon install mcamvusb.inf root\mcamvusb
    But when running as administrator the .bat file, just the command prompt opens and closes without doing more. If I copy/paste the files to system32 directory and run the .bat file from direcory "C:\Windows\System32" everything is Ok. How can I run the batch file from "C:" drive?

      My System SpecsSystem Spec

  2. #2


    What is devcon and where does it reside.

    For testing, remove the @ in front of @devcon.
      My System SpecsSystem Spec

  3. #3


    Posts : 8
    Windows 8.1


    devcon.exe with some other files are all in the same folder that you can see them here:
    Code:
    http://www.solidfiles.com/d/af549f4b47/
    If you copy the "USB-Emul_Win64" folder to C:\ directory and run as administrator the install.bat file the driver is installed succesfully. (In windows 7 x64)
    If you copy
    "USB-Emul_Win64" folder to C:\ directory and run as administrator the install.bat file the driver isn't installed succesfully. (In windows 8.1 x64)
    If you copy the contents of "USB-Emul_Win64" folder to C:\Windows\system32 directory and run as administrator the install.bat file the driver is installed succesfully. (In windows 8.1 x64)

    To be installed the driver, the OS must be booted in "disable driver signature enforcement" mode by F8 (Windows 7) or Shift + Restart combination (Windows 8.1) in all above situations.

    So, why the install.bat file does not execute when it is located in C:\ direcory in Windows 8.1 x64?
      My System SpecsSystem Spec

  4. #4


    Let me ask again.

    What is devcon.exe. All you talked about was USB-Emul_Win64 and install.bat.
    Does install.bat use devcon.exe? If so, post the contents of install.bat, maybe that will help figure this out.
      My System SpecsSystem Spec

  5. #5


    Posts : 8
    Windows 8.1


    I don't know exactly what devcon.exe does. I want to install a driver that is provided by other person. All I know is that install.bat uses devcon.exe (devcon.exe uses enum.exe,, mcamvusb.inf and...) to install a driver, to have a USB emulator. If you take a look at what I've uploaded, you can notice them. All the files are in a folder called "USB-Emul_Win64".

    The content of install.bat was shown on first post
    Code:
    @devcon remove root\mcamvusb
    @devcon install mcamvusb.inf root\mcamvusb
    The problem is I want to install that driver (by right click and run as administrator the install.bat) from C:\ directory. But I can't do that in Windows 8.1 x64 (it is possible to install only from \windows\system32). However there is no prblem to install if from C:\ in Windows 7 x64.


    Let me ask in other words. Why a batch file that is runned from \windows\system32 directory but it is not runned from another directory like C:\?
      My System SpecsSystem Spec

  6. #6


    I don't know, sounds like a permissions problem.

    Try removing the @ from @devcon in the bat file, see if that gives you any more info.
      My System SpecsSystem Spec

  7. #7


    Posts : 2,690
    Windows 3.1 > Windows 10


    Code:
    cd /d "%~dp0"
    @devcon remove root\mcamvusb
    @devcon install mcamvusb.inf root\mcamvusb
    try adding the first line to the install.bat above to tell cmd to use current directory to find devcon

    Code:
    cd /d "%~dp0"
    devcon.exe remove root\mcamvusb
    devcon.exe install mcamvusb.inf root\mcamvusb
      My System SpecsSystem Spec

  8. #8


    Posts : 8
    Windows 8.1


    That's it. Now it works as it should work. Thanks a lot KYHI!
    Last edited by J4NY4R; 02 Jun 2015 at 02:19.
      My System SpecsSystem Spec

  9. #9


    What time should be used or changed in the file for getting it activated
      My System SpecsSystem Spec

Problem with running batch file in certain directory
Related Threads
I'm trying to create a NETSH batch file that sets my TCP/IP settings to DHCP. The line I want to use is: netsh interface ipv4 set address name="My Custom Named Network" dhcp If I run the global cmd prompt and paste this line, it works as intended. However, if I create a batch file with the...
Solved Batch File Question in Installation & Setup
I'm in the process of automating configuration for Windows at installation, like disabling services that are exploitable or that I just don't use. I wrote a batch file script for disabling the services, but now I would like to disable NetBIOS over TCP/IP using a batch file command. This is how to...
Need Batch File Help in General Support
First off, sorry if this is not posted in the right forum. I wasn't sure if it was more appropriate here or in the "Chillout Room" or elsewhere. I'm a noob when it comes to batch scripts, so I'd appreciate any help I could get. I tried doing all sorts of searches to find my answer (at least one...
I accidentally set the file open of .bat files to Notepad. From a link in this forum (How to Restore Default File Extension Type Associations in Windows 8 and 8.1)was able to reset the registry back I think. The bat file not longer asks for notepad but instead opens "How do you want to open this...
I need a way to play a video constantly all day, I found the following batch file which when edited for my video works perfectly in both Chrome and Firefox but does not work in Internet explorer(IE) Does any one have a solution for IE please. The Batch file is as follows:- <!DOCTYPE html> <html>...
If anyone is interested, I made a tutorial on using a batch file to run dism & sfc. https://www.eightforums.com/windows-updates-activation/40095-windows-update-wont-download-sfc-finds-corrupt-cant-fix-2.html#post336782 I hope it is useful to someone. :)
Solved Batch file question in General Support
Hi, I'm writing a small batch file, but it doesn't show everything. Can you help? @echo offsetLocal EnableDelayedExpansion pushd "C:\Users\%username%\Desktop" type nul > "%hostname% %username%" I also want to add IP-address (and maybe leave the username out).
Eight Forums Android App Eight Forums IOS App Follow us on Facebook