Hi,
Has anyone had any issues using run cmd /c command in Windows 8 or 8.1 x64? I have the following line in an XY script which works fine on Windows 7 x64 (on 2 computers), but it will not run in Windows 8. The reason is that the devcon command I'm running requires that it be run with Administrative privileges.
Code: Select all
run "cmd /c D:\Tools\DevCon\devcon.exe disable USB\ROOT_HUB20 & D:\Tools\DevCon\devcon.exe enable USB\ROOT_HUB20", , 2, 0;
I've used the command in an open command prompt window with admin privileges and it works fine, but doesn' work if open a prompt without admin privileges or run from a XY script. The Microsoft devcon.exe utility can restart, list, enable, and disable, any device (e.g., keyboard, mouse, sound driver, etc). In this case I'm using it to restart a flash or external hard drive that have been safely removed but not physically removed from the computer. Windows 7 must be automatically running the cmd with elevated privileges whereas Windows 8 does not, even though I'm the sole user and administrator. I've done some searching and read about the "runas" command which I haven't got to work properly. I was initially hoping CMD had a switch to run it with Admin privileges but it doesn't. You'd think it would automatically run CMD with elevated privileges when the user is admin which I guess is what Windows 7 does. Anyone have any ideas or encounter something similar?
Thanks,
Ken