/build/static/layout/Breadcrumb_cap_w.png

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)

Posted by: jknox 8 years ago
Red Belt
1
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.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ