(imported comment written by SystemAdmin)
We’re using BES Client Version 7.0.1.376.
Using “{parameter “OUTPUTLOG”}” does work elsewhere in the script for simple output such as:
dos echo OUTPUTLOG= “{parameter “OUTPUTLOG”}” >> “{parameter “OUTPUTLOG”}”
As of this afternoon, I was able to get the code to work as expected. I believe I was running into 2 issues: 1) The Fixlet Debugger doesn’t seem to like the code. 2) A problem with quotation marks.
Here’s sample code that works as a task but not in the Fixlet Debugger:
dos if not exist {(value of variable “SystemDrive” of environment) & “\Test”} md {(value of variable “SystemDrive” of environment) & “\Test”}
parameter “OUTPUTLOG” = “{(value of variable “SystemDrive” of environment) & “\Test” & (computer name) & “_TestOutput.txt”}”
dos if exist “{parameter “OUTPUTLOG”}” del “{parameter “OUTPUTLOG”}”
dos echo OUTPUTLOG= “{parameter “OUTPUTLOG”}” >> “{parameter “OUTPUTLOG”}”
dos echo. >> “{parameter “OUTPUTLOG”}”
dos echo BES Clinet Version = {version of client} >> “{parameter “OUTPUTLOG”}”
dos echo. >> “{parameter “OUTPUTLOG”}”
waithidden cmd.exe /C {(pathname of system x32 folder) & “\cscript.exe”} /NoLogo {(pathname of system x32 folder) & “\IISBack.vbs”} /List >> “{parameter “OUTPUTLOG”}”
Here’s the final code that worked for me:
//---------------------------------------------------------
// Set some parameter variables.
//---------------------------------------------------------
parameter “IISBKUPS” = “{(value of variable “SystemDrive” of environment) & “\LOGS\IISAudit\IISBackups” & (computer name) & “_IISBackupsExtract.txt”}”
parameter “SCRIPTHOST” = “{if exists (x64 registry) then (pathname of system x64 folder) & “\cscript.exe” else (pathname of system x32 folder) & “\cscript.exe”}”
//---------------------------------------------------------
// Remove old files if they already exist.
//---------------------------------------------------------
dos if exist “{(value of variable “temp” of environment) & “\Adsutil.vbs”}” del “{(value of variable “temp” of environment) & “\Adsutil.vbs”}”
dos if exist “{(value of variable “temp” of environment) & “\IISAudit.vbs”}” del “{(value of variable “temp” of environment) & “\IISAudit.vbs”}”
dos if not exist {(value of variable “SystemDrive” of environment) & “\LOGS\IISAudit\IISBackups”} md {(value of variable “SystemDrive” of environment) & “\LOGS\IISAudit\IISBackups”}
dos if exist “{parameter “IISBKUPS”}” del “{parameter “IISBKUPS”}”
//---------------------------------------------------------
// Download file(s)
//---------------------------------------------------------
download http://someserver:port/Win/IISAudit.vbs
download http://someserver:port/Win/Adsutil.vbs
//---------------------------------------------------------
// Move files from download folder.
//---------------------------------------------------------
move __Download\Adsutil.vbs “{(value of variable “temp” of environment) & “\Adsutil.vbs”}”
move __Download\IISAudit.vbs “{(value of variable “temp” of environment) & “\IISAudit.vbs”}”
//
// Run Script
//-----------------------------
if {exists x64 registry}
action uses wow64 redirection false
waithidden cmd.exe /C {parameter “SCRIPTHOST”} /NoLogo “{(value of variable “temp” of environment) & “\IISAudit.vbs”}”
waithidden cmd.exe /C {parameter “SCRIPTHOST”} /NoLogo {(pathname of system x32 folder) & “\IISBack.vbs”} /List >> “{parameter “IISBKUPS”}”
action uses wow64 redirection true
else
waithidden cmd.exe /C {parameter “SCRIPTHOST”} /NoLogo “{(value of variable “temp” of environment) & “\IISAudit.vbs”}”
waithidden cmd.exe /C {parameter “SCRIPTHOST”} /NoLogo {(pathname of system x32 folder) & “\IISBack.vbs”} /List >> “{parameter “IISBKUPS”}”
endif
//-----------------------------
// Script Complete
//-----------------------------
Thanks again for your help, Ben; I appreciate it.
Dean