Need help running a batch script from an elevated command prompt on the K1000.
I am trying to run a batch script that has to be run from an elevated command prompt. I know I have done this before, but I can't seem to get it to work now. It is set up as an online kscript with Run as User checked and the administrator credentials are provided. When I run the script, it does not complete. If I go into the dependency directory and right click the batch file and hit run as administrator, it runs fine.
Answers (3)
try this
Comments:
-
When I tried that, the script failed with the message that it could not find the file specified. - WGM_Jeff 10 years ago
OK, no matter what I tried, I could not get it to run. It seems that when KACE calls the script it uses the command prompt that is in SYSWOW64 instead of System32. The file I need to call was in the system32 folder.
I added bcdedit as a dependency to the script and it is working now.
Comments:
-
good to hear
I have been trying to use the steps I would put in a batch file as lines in scripts and have had lots more success. I usually use the dos paths to call the exe's instead of a variable for that reason. a couple of exe's have both 32 and 64 copies in the OS and if you do not call the proper version things do not happen as they should sometimes. the fall back is sometimes I have to create a 32 and 64 bit script to do the same thing. - SMal.tmcc 10 years ago
Runas (place username and password) (xxx.bat) - SMal.tmcc 10 years ago
Also if you can post your batch, they may be a more direct method to calling what you are trying to do.
Note: I have had to switch to calling cmd.exe as the program to run with 3.5 and put the batch file in the parameters with some things.
you would Launch c:\windows\system32\cmd.exe with params /c my.bat - SMal.tmcc 10 years ago