Batch file
Hello
I am having an issue getting a batch file to run through kace correctly. The batch file renames the computer and then reboots it. When I run the batch through kace it will reboot the machine but does not change the name. I can run the batch file locally on the pc and it works great. Below is the batch file I am using
cd\
cd %WINDIR%\system32
WMIC computersystem where caption='%computername%' rename IT1234567
shutdown /r /t 0
What am I doing wrong?
Thanks
4 Comments
[ + ] Show comments
-
Are you running it as a script? If so, Offline or Online KScript? - rockhead44 8 years ago
-
Sorry forgot that information, yes as a script online - joshuaer 8 years ago
-
When you run it locally, are you running it with administrative privileges? Is the machine joined to a domain? If so, you need to execute the script with appropriate credentials to perform the operation. - nheyne 8 years ago
-
thank you very much, I thought I had tried that but apparently I did not. Thank you for your help - joshuaer 8 years ago
Answers (1)
Please log in to answer
Posted by:
jknox
8 years ago
Kscripts by default run as the LocalSystem account. In order to change the machine name, you will need administrator access, something LocalSystem does not have.