Solved Problem with running batch file in certain directory

J4NY4R

New Member
Messages
8
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 Computer

System One

  • OS
    Windows 8.1
What is devcon and where does it reside.

For testing, remove the @ in front of @devcon.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
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 Computer

System One

  • OS
    Windows 8.1
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 Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
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 Computer

System One

  • OS
    Windows 8.1
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 Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
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 Computer

System One

  • OS
    Windows 3.1 > Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Dell XPS 8700
    CPU
    I7
    Memory
    24 GB
Back
Top