I'm trying to run a Batch File Script within the K1000 to remove part of an Office 2010 install. I've made an XML file with the changes and a one-line batch file to run SETUP.EXE with the /MODIFY option. This method works properly when I run the batch file locally, with the XML file in the same folder.

If I add the XML file as a dependency and then paste the contents of the batch file into the Remediation Section under 'run a batch file', it fails because it can't find the XML file. If I alter the line with the specific path of where Kace puts the file locally on the test drive, it works properly, so I'm fairly sure that the Script setup is properly within Kace.
What I'd like to do (for this and any other scripts of this nature), is to provide a variable path of some sort that will tell the program to look in the root folder where Kace puts the dependency file when the script runs. Based on some other forum posts, I should be able to run the line as follows:

"%CommonProgramFiles%\Microsoft Shared\OFFICE14\Office Setup Controller\setup.exe" /modify ProPlus /config "$(KBOX_DEPENDENCY_DIR)\alteroff2010.xml"

Unfortunately, what I get back is an error that says:

Cannot find the specified config.xml file. C:\Program Files\Common Files\Microsoft Shared\OFFICE14\Office Setup Controller\$(KBOX_DEPENDENCY_DIR)\alteroff2010.xml

I've tried the line with and without the quotation marks over the path with the same outcome. I've also tried just leaving the filename only but, again, it keeps looking at the root level of where SETUP is and not where Kace places the dependency file. I'm hoping that it's a simple syntax issue here. Any help is appreciated. Thanks!

0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Trying running your script as a shell script instead of a kscript.

Then you can just upload your xml as a dependency.

If you use a shell script you don't need to mess with the Kace dependency directories.

Just make sure you change your script name from script.sh to script.bat.
Answered 08/17/2011 by: dchristian
Red Belt

Please log in to comment
Thank you for your reply. I tried it as a shell script and ran into the same result (cannot find xml file). The process is running, it's just that the program cannot find the XML file unless you specify the full, local path. I did some more checking and found the passage listed below. It was part of a Kace tutorial on setting up a different type of script but addressed my issue.

Unless I'm misunderstanding it, Kace creates a static number for each scripting process. You then use that number as your destination folder name to any dependency files for the script to work. I was concerned that this number would change but the passage below indicates that it will not.

Please NOTE: XXXX is the kbots script number, You will have to make sure you identify the location of the script (its specific kbot number) for use in your “RunOnce” command. To do this, save your script, hover over the script in the list view and the number displayed at the bottom of your browser window is the kbot number. Once you retrieve the number you can select the script and edit your batch file.
Answered 08/17/2011 by: MMSMSD
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity