Script to Copy .exe from KACE to PC Not Working
Hello!
I'm looking for help with a script that doesn't seem to be working for me. The goal is to copy & replace an .exe on a workstation with a new version of that .exe I have saved as a dependency in KACE. The script seems to end the processes but I can't figure out why the copy/replace isn't completing. I've tried this as a batch file as well. I have run this as the local SYSTEM user as well as with the local administrator credentials.
Here is essentially what I've got, though I've tried several variations:
The new .exe is set as a dependency
Task 1
Verify the directory exists
Verify the file exists
Verify process isn't running
On Success
Launch “C:\Windows\System32\cmd.exe” with params “xcopy ”$(KACE_DEPENDENCY_DIR)\newfile.exe c:\Program Files\Existing Directory /q /y“”.
Remediation
Kill process
On Remediation Success
Launch “C:\Windows\System32\cmd.exe” with params “xcopy ”$(KACE_DEPENDENCY_DIR)\newfile.exe c:\Program Files\Existing Directory /q /y“”.
Log "Success" to output
On Remediation Failure
Log "failure" to output
2 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
chucksteel
6 years ago
When running cmd.exe to execute a command you need to specify the /c flag. This:
Launch “C:\Windows\System32\cmd.exe” with params “xcopy ”$(KACE_DEPENDENCY_DIR)\newfile.exe c:\Program Files\Existing Directory /q /y“”
Should be:
Launch “C:\Windows\System32\cmd.exe” with params “/c xcopy "$(KACE_DEPENDENCY_DIR)\newfile.exe" "c:\Program Files\Existing Directory" /q /y”
I think that your quotes for the xcopy command might have also been off.
I only see a "schedule" I can set with hourly windows. Is there a way to push this out immediately? - jasti 6 years ago
for File Sync: force inventory (or run c:\program files (x86)\quest\kace\runkbot 6 0, that not a full inventory but only the file sync and MI is running) - Nico_K 6 years ago