/build/static/layout/Breadcrumb_cap_w.png

Dependency Path Problem

Hi,
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!

Michael

0 Comments   [ + ] Show comments

Answers (2)

Posted by: dchristian 12 years ago
Red Belt
0
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.
Posted by: MMSMSD 12 years ago
Senior Yellow Belt
0
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.

[hr]
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.
[hr]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
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