Scripting Question

XCOPY not working in KACE script works in Command prompt.

07/18/2014 6254 views

I have been tryin to copy 3 files to 3 different paths.  The command lines I have written all work in a command prompt.  When I copy them to KACE and run the script, the command prompt pops ups on the client screen but the files do not copy to thier destination. 

The three lines of script I have are:

start /wait xcopy \\(SERVERNAME)\library\software\scripts\Registry.pol c:\Windows\System32\GroupPolicy\Machine\ /E /C /I /Q /G /H /R /K /Y /Z /J
start /wait xcopy \\(SERVERNAME)\library\software\scripts\gpt.ini c:\Windows\System32\GroupPolicy\ /E /C /I /Q /G /H /R /K /Y /Z /J
start /wait xcopy \\SERVERNAME)\library\software\scripts\loudprint1-PC-printers.vbs c:\Windows\System32\GroupPolicy\Machine\Scripts\Startup\ /E /C /I /Q /G /H /R /K /Y /Z /J

I have in the script the three files as dependencies and have also tried running the directly from the kbot folder.

I have tried putting the three lines in a bat file and executing the bat file.

I have tried incasing the individual locations in quotes: start /wait xcopy "\\(SERVERNAME)\library\software\scripts\Registry.pol" "c:\Windows\System32\GroupPolicy\Machine\ /E /C /I /Q /G /H /R /K /Y /Z /J"

This is something that cannot be pushed out via Group Policy from AD.  This application is only used in select rooms and the users can login at other location that we don't want the policy in effect.

These are all Windows 7 systems.

I know I am missing something so if someone can let me know what it is I would greatly appreate it.


PS one more thing... would like to eventually get this to run silent.

Answer Summary:
0 Comments   [ + ] Show comments


Community Chosen Answer

drop the start  /wait

Create a zip with the 3 files, an install.bat, and a vbs file to hide the bat running.  Upload the zip as a dependency.

use this to run the kscript

Answered 07/18/2014 by: SMal.tmcc
Red Belt

  • you will need to run this as local system or admin not logged on user since they have no rights to system32
    • I set up the script indentical to your instruction. I don't see any dos windows pop up. The files still do not get written to thier destinations. I have it set to run as the local administrator using Run As User: (Name) Password: (Password)
      • The bat file will run outside of KACE and it works.
      • lets dump the switches that are not needed. use just /q /y /r /h
      • On the kscript page point the mouse at the script and get the id= from the bottom of the browser page.

        On a machine that this is already pushed to go to C:\ProgramData\Dell\KACE\kbots_cache. you should have an xml file there that starts with that id.

        edit it in notepad
        look thru to xxxxxxx the admin password
        save to your desktop

        then go to
        and give me a screen shot of the directory.

        also can you include a screen shot of your kscript?

        if it easier for you, email all that to smal.tmcc@gmail.com
      • Got it figured out for both 32 bit and 64 bit
        change the install.bat:

        %windir%\Sysnative\attrib c:\windows\system32\grouppolicy -h -r -s
        %windir%\Sysnative\attrib c:\windows\system32\grouppolicy\*.* /s /d -h -r -s

        %windir%\Sysnative\xcopy Registry.pol c:\Windows\System32\GroupPolicy\Machine\ /q /y

        %windir%\Sysnative\xcopy gpt.ini c:\Windows\System32\GroupPolicy\ /q /y

        %windir%\Sysnative\xcopy "loudprint1-PC-printers.vbs" c:\Windows\System32\GroupPolicy\Machine\Scripts\Startup\ /q /y

All Answers

Still nothing copied.
Answered 07/18/2014 by: adminlo
White Belt

Without knowing much about Kace, if it happens to use a localservice account to handle the installation, this account will not have network access privileges hence it will not be able to access the network source.
As a test, put the files locally and try the (amended) xcopy operation via Kace with a local source and target.
A copy may require you to make a connection to the source server using NET USE and a domain account with access to this source location and then run an XCOPY operation.  It's probably much simpler to create a small installer for these three files and deploy that via KACE rather than struggling with DOS commands.
Answered 07/21/2014 by: EdT
Red Belt

Don't be a Stranger!

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

Sign up! or login

View more:


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