Copy Files to Folders

(imported topic written by SystemAdmin)

Good day,

We’re having a hard time creating a Fixlet that should be relatively easy to make. It is composed of a folder with two files. Once downloaded one file goes into a specific folder and the other file goes into another. My action script is below along with the error I’m receiving:

Server error: “HttpRestartableBadHttpStatus”

5 of 432 retries: next attempt in 00:04:00

download http://bigfix.company.net:52311/Uploads/fc0c289669ed6bb887f0b575245209a976e3c620/MyData.tmp

continue if {(size of it = 6956 AND sha1 of it = “fc0c289669ed6bb887f0b575245209a976e3c620”) of file “MyData.tmp” of folder “__Download”}

extract Folder.tmp

// wait __Download\setup.exe

copy “__Download\File1.ico” “C:\WINDOWS\system32\File1.ico”

copy “__Download\File2.url” “C:\Documents and Settings\All Users\Desktop\File2.url”

(imported comment written by Lee Wei)

The URL to the file is probably not valid, or the size and SHA1 might not be correct.

  • You should verify the URL by cut-and-paste the it in a browser for testing.
  • Also look for the file on the BigFix Server to verify that it has the correct size and SHA1. The location should be

C:\Program Files\BigFix Enterprise\BES Server\wwwrootbes\Uploads

Lee Wei

(imported comment written by SystemAdmin)

Lee,

When I cut and paste the URL into a browser I get a bunch of random text, ie

##SC001W¨¥hxœí\ |MÇ÷Ÿ÷Ô®Dà RZ­Ù#$ÄZ‰Rú«KBü(±Ä.›ìë‹-¶T±×Njb X’È&$ÖȾ¼w¿ÿ3÷½D„ªýõ¯æ““y÷Þ™9ó=çÌ™3óæ]ëÚ z q£=qÜTÖrè [­Vzú­Žqh¥§£«Cÿ:ëu¦íu(MÎ(I˜37çy+Ö¶cFt¯U+åuDÆFѽ †×vêŒUÂX[*CUØ"¦¼/¦ìu“„ˆZbÕߪ¦Â#y ÜõˆÚõ$úî=¡þDà ‰¾&ªó ìšjŒ ®à ˜Ñ&¢­$ŒèÿïD€·J #|ÎDýˆV0Vƒäb˜µ „ ZÈØcWÆ Þšà ØÓŸKmà Ø1‚BÔ›¨f9þÇ4B¬ÉÞ—HØ eR†°¦ ±±u«÷†~i¦ ŽkŽ„å´VÊÀ‰¨%Ç>‡ ~…«

When we check C:\Program Files\BigFix Enterprise\BES Server\wwwrootbes\Uploads we aren’t able to find of of the instances we attempted to upload the file. Matter of fact we don’t have anything there that has this years date.

Should we be calling in and creating an incident with you guys?

(imported comment written by Lee Wei)

The files in the Uploads folder are loaded by the Software Distribution Wizard.

So you can use the Wizard to upload the file to the location again.

The random text is actually a good symptom. You are accessing a compressed file, which means that the file is being picked up.

It does not reconcile that you can file the file in the browser, yet not in the directory structure. That does not make sense.

Support is always a good option.

(imported comment written by SystemAdmin)

Thanks Lee

I just emailed support.

(imported comment written by SystemAdmin)

Deploying problem resloved… Thank you Lee.

Can you still help us out with our action script though. We made a few changes. Below is what we have:

download http://bigfix.companyname.net:52311/Uploads/f51760c20be704fd49848339aa90662d40f45150/MyData.tmp

continue if {(size of it = 6960 AND sha1 of it = “f51760c20be704fd49848339aa90662d40f45150”) of file “MyData.tmp” of folder “__Download”}

extract FolderName.tmp

// wait __Download\setup.exe

copy __Download\File1.ico “C:\WINDOWS\system32\File1.ico”

copy __Download\File2.txt “C:\Documents and Settings\All Users\Desktop\File2.txt”

move “C:\Documents and Settings\All Users\Desktop\File2.txt” “C:\Documents and Settings\All Users\Desktop\File2.url”


We’re failing out at the following line

move “C:\Documents and Settings\All Users\Desktop\File2.txt” “C:\Documents and Settings\All Users\Desktop\File2.url”

(imported comment written by SystemAdmin)

Never mind, we fixed it with a

parameter “startTime”="{now}"

pause while { (now-time(parameter “startTime”) < 30*second) }

between the last copy and move, ie

copy __Download\File2.txt “C:\Documents and Settings\All Users\Desktop\File2.txt”

parameter “startTime”="{now}"

pause while { (now-time(parameter “startTime”) < 30*second) }

move “C:\Documents and Settings\All Users\Desktop\File2.txt” "C:\Documents and Settings\All

Users\Desktop\File2.url"

(imported comment written by Lee Wei)

Thanks for letting me know that it is fixed.

I would have spent time looking at the code… :slight_smile:

(imported comment written by dlwoodham91)

Looks like I am having a similar problem and the file that is downloading is 91mg how can I make the script to wait for the download to finish? Seem that the msi tries to install without the file completely downloading.

download http://xxxx.xxx.com:9029/Uploads/643a42429564aa773d62e7765bf0c7b07c2b53e0/someprogram_10.0_EN_02.tmp

continue if {(size of it = 96201374 AND sha1 of it = “643a42429564aa773d62e7765bf0c7b07c2b53e0”) of file “someprogram_10.0_EN_02.tmp” of folder “__Download”}

extract someprogram_10.0_EN_02.tmp

wait “{pathname of system folder & “\msiexec.exe”}” /i “{(pathname of client folder of current site) & “__Download\someprogram 10 SP1 silent 32.msi”}” TRANSFORMS=“someprogram_10.0_EN_02.mst” /qn /l*v “%systemroot%\debug\TrendMicro_Office-Scan-Client_10.0_EN_02.log”

I confirmed on the server that the files exist and is accessible through the browser as well… Just seems that it does not download

(imported comment written by Lee Wei)

dlwoodham,

The way the ActionScript works is that the Client will parse the script looking for items to download.

The Action will not start until and unless the file has been downloaded successfully.

So there is no need to explicitly wait for the download to complete.

The client log file might provide additional information specific to the failure.

Lee Wei