written by jmlafreniere91)
Hello, I’m trying to create a Bigfix script that copies some files to the %appdata% of the current user.
Could you please tell me how I can do that ?
I’ve been trying to use the Windows Software Distribution Wizard to push the files to the server, then execute a .CMD file that copies the data to %appdata%, but the data is never written.
Action script:
download http://bigfix.domain.com:52311/Uploads/51ffb2dc7678f0ee1ad28d6e9640ec095aaf2fc6/signature.tmp
continue if {(size of it = 15093 AND sha1 of it = “51ffb2dc7678f0ee1ad28d6e9640ec095aaf2fc6”) of file “signature.tmp” of folder “__Download”}
extract signature.tmp
wait __Download\signature.cmd (see content of signature.cmd below)
I’ve also tried this, to no avail.
wait __Download\signature.cmd “{value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry}\Microsoft\Signatures”
Content of signature.cmd:
@echo off
rem This section creates the Signatures directory if it doesn’t exist
if exist “%appdata%\Microsoft\Signatures” goto copy
mkdir “%appdata%\Microsoft\Signatures”
rem This section copies the files
:copy
rem This section creates a log if files are already present
if exist “%appdata%\Microsoft\Signatures\flag.sig” echo Signature files already installed > “%appdata%\Microsoft\Signatures\signature.log”
rem This section copies the files if not present
if not exist “%appdata%\Microsoft\Signatures\flag.sig” copy /y “\domain.com\netlogon\itsd\templates\signature\signature\Signature.*” “%appdata%\Microsoft\Signatures”
Could you please tell me what I should do ? Can I use something else than the .CMD and use the dos copy command instead, but how does it work knowing that Bigfix uses the SYSTEM account ?
Regards,
JML