Trying deploy a batch file to create a folder and pull a file into it

(imported topic written by Sean_Mahanay91)

Sorry if this request is in the wrong location.

I am trying to deploy a batch file that will create a folder if needed and pull a file into it. In some cases the folder and file may already exist. The batch file file has been written to create the folder only if needed and overwirte the existing file if present. The batch file has been tested on multiple user systems and runs fine when running locally. When deployed as task Bigifix report it complete, but the file does not get copied over.

Here is my action script:

download http://checkin.COMPANY_SERVER.com:52311/Uploads/feae04e7504afc49cace1c13ca9c42b006b233a8/putconfigbat.tmp

continue if {(size of it = 295 AND sha1 of it = “feae04e7504afc49cace1c13ca9c42b006b233a8”) of file “putconfigbat.tmp” of folder “__Download”}

extract putconfigbat.tmp

wait “{pathname of system folder & “\cmd.exe”}” /Q /C “{(pathname of client folder of current site) & “__Download\putconfig.bat”}”

Here is my batch file:

for /f "tokens=1 delims= " %%D in (’%WINDIR%\system32\findstr.exe /i %COMPUTERNAME% \ca01-sv01-fs01\Public\RM\target.txt’) do (

set USER=%%D

if not exist “%homedrive%\Documents and Settings%username%\Application Data\Subversion” mkdir “%homedrive%\Documents and Settings%username%\Application Data\Subversion”

copy /y \ca01-sv01-fs01\Public\RM\config “%homedrive%\Documents and Settings%username%\Application Data\Subversion”

)

Any help is very much appreciated as I need to deploy this file to 300+ systems.

(imported comment written by NoahSalzman)

BigFix runs as SYSTEM. You have a \network_share in your script. Are you familiar with the

null share KB article?

(imported comment written by Sean_Mahanay91)

Yes, I am familiar with null shares. Is there any way to tell the batch file to run as user once downloaded?

(imported comment written by NoahSalzman)

Hers is the KB aritcle: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=392

You may also want to search in the Forums for “runascurrentuser” to see some recent examples.

(imported comment written by Sean_Mahanay91)

Does this utility Runascurrentuser need to be installed on each system to be able to use the command?