Copy file to the Main Server to Station

Hello all,

I’m trying to make a task to simply copy a file from the main server to a station.
i’ve tried a simple script (copy “c:\test.txt” “c:\test\test.txt”), but this only works locally.

Anyone??

Not really sure what you are talking about, but copy will only work if the folder already exists. You have to use folder create to create the folder if it is missing.

The folder exists, it’s only a copy of .ini file.

Are you trying to copy it to a network location?

I’m still confused about what you are doing that is failing, other than it involves a copy.

For this you can create a IEM Task that will have your .ini file.

Then copy this file to designated location on Client machine.

Your IEM Task should look like below:

Copy “__Download\abc.ini” “C:\Test\abc.ini”

Regards,
AKS

1 Like

Where on a network are you trying to copy it too. I think you would need to have the permissions for the folder you are trying to copy to Everyone (FULL CONTROL or MODIFY (at least))

You can also run a BAT file to do this.

The file is on the main server, and the folder has full control to everyone.
I did .bat file which is working when you run on the machine, but i’m not able to make a task to deploy.

Anyone has a exemple to help me??

You can run a BAT from SHARED location on the network.

This is an example of what we use.

waithidden cmd /c “\<SHARE>\Clean-Up-Adobe-Flash-Uninstall.cmd”

Thanks team…it’s working now:

download http://bigfixserver:52311/Uploads/9679eb7f4fd431173ca9adcac86f7cf447e7adfc/test.txt.tmp
continue if {(size of it = 70 AND sha1 of it = “9679eb7f4fd431173ca9adcac86f7cf447e7adfc”) of file “test.txt.tmp” of folder “__Download”}

extract test.txt.tmp
copy __Download\test.txt “C:\temp\test.txt”

Good to hear that your problem has been resolved and copy command worked as usual. :grinning:

Regards,
AKS

It is better to use a prefetch command instead of a download command. It makes better use of the caching infrastructure and doesn’t hold up action execution for the download.

I didn’t realize you were just trying to download a file onto the client and then put it into place.

This is more of a side note as it is unrelated to the main question, but I don’t understand why you would run a batch file from a shared network location @psbank ?

This seems unnecessarily complicated and prone to problems.

It would be much better to create the command file using the create file actionscript on the endpoint and then run it.

If the batch file is simple enough, then it would be even better to just convert it into single commands each with a wait in front.