Appendfile and move problems

(imported topic written by SystemAdmin)

I’m having an issue on my clients where an action is failing when trying to use the appendfile functionality. I’m using the exact same action language that I have successfully used in the past but the action is now failing on clients when I try and move the appendfile to a separate file. I am also trying to use the Fixlet Debugger and I get an error when it tries to parse the move command as well. The action language is shown below with the 3rd line being (the move line) the one clients are failing on. I am perplexed. I am posting the script from a specific action but this is not the only task that uses appendfile/move that is failing in my environment. What am I doing wrong?

I am running BES 7.1.1.315. All clients referenced are XP based.

// Create status file

appendfile Starting CSA install

move __appendfile {pathname of windows folder}\temp\preinstall.txt

download http://servername:52311/Uploads/baafe42aa97acc3ce0a5ec9366deae7f47889293/{D933754D-B870-45b7-BFAA-1BDD2A7D4B80}.tmp

continue if {(size of it = 22229596 AND sha1 of it = “baafe42aa97acc3ce0a5ec9366deae7f47889293”) of file “%257bD933754D-B870-45b7-BFAA-1BDD2A7D4B80%257d.tmp” of folder “__Download”}

extract %7bD933754D-B870-45b7-BFAA-1BDD2A7D4B80%7d.tmp

if {exists service “csagent”}

waithidden __Download\setup.exe /s --autolevel=4 --disable_net=0 --reboot=0

delete __appendfile

appendfile net stop csagent

move __appendfile stopcsa.bat

waithidden stopcsa.bat

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\Cisco\CSAgent\Persistent@NetSet

" “@InitialSecurity”=dword:6

delete __appendfile

appendfile net start csagent

move __appendfile startcsa.bat

waithidden startcsa.bat

else

waithidden __Download\setup.exe /s --autolevel=4 --disable_net=0 --reboot=0

endif

(imported comment written by sthull)

Make sure the target path exists and the target file does not exist before doing the move:

if {not exists folder (pathname of windows folder & “\temp”)}

dos mkdir {pathname of windows folder}\temp

else

delete {pathname of windows folder}\temp\preinstall.txt

endif

(imported comment written by SystemAdmin)

It was the preexistence of the file that got me plus I don’t think the fixlet debugger has all the bugs worked out of it yet. I can run the action (with your suggested modifications) and it works fine yet when I take the same action script and put it in the debugger it still fails on the move command.

Oh well, the important thing is my action is working. Thanks for the help.