Delete and Copy

(imported topic written by bendernet91)

What is wrong with this action?

dos cmd /c rd /q /s “C:\Program Files\Mozilla Firefox\extensions{77b819fa-95ad-4f2c-ac7c-486b356188a9}”

waithidden cmd.exe /C copy “\servershare\source\IETab2*.*” “C:\Program Files\Mozilla Firefox\extensions”

Cannot get either one to work. source is the share. Perms are correct.

Steve

(imported comment written by NoahSalzman)

Please don’t use the “dos” command, use run, wait, runhidden, or waithidden.

Please escape your {, like this:

waithidden cmd /c rd /q /s “C:\Program Files\Mozilla Firefox\extensions{{77b819fa-95ad-4f2c-ac7c-486b356188a9}”

Start there. If that doesn’t work please let us know.

(imported comment written by bendernet91)

Thanks! The first part worked. Now having trouble getting the second line to work…

waithidden cmd.exe /C copy “\servershare\IETab2*.*” “C:\Program Files\Mozilla Firefox\extensions”

IETab2 is the share. The folder contents is a directory named {1BC9BA34-1EED-42ca-A505-6D2F1A935BBB}

(imported comment written by Lee Wei)

When the BigFix Client runs this ActionScript statement, it is running as Local System.

So you might be having problem with Local System not having access to the share.

If that is the case, you can search for the use of RunAsCurrentUser.exe to impersonate the user logged in.

(imported comment written by SystemAdmin)

It’ll probably only work as local system if the network share is a null-session share.

Otherwise, if you use RunAsCurrentUser, make sure that user has modify permission to the target folder. If the user doesn’t, then use RunAsCurrentUser to just copy the file from the network share to the user’s temp folder. Then (as local system) locate the user’s temp folder and copy it into place. However, if no-one is logged onto the PC, then this won’t work either - so only deploy it if someone is logged on.

Btw, if you look at the end of this, I show how I determine where the user’s temp folder is:

http://forum.bigfix.com/viewtopic.php?id=6045

Paul

(imported comment written by bendernet91)

I set up the null session share and it was able to copy a file for testing purposes. However, cannot get this directory to copyits contents…

waithidden c:\windows\system32\cmd.exe /C copy /Y “\servershare\IETab2{1BC9BA34-1EED-42ca-A505-6D2F1A935BBB}” “C:\Program Files\Mozilla Firefox\extensions”

(imported comment written by NoahSalzman)

Don’t forget to escape your curly braces in Action Script.

http://support.bigfix.com/cgi-bin/kbdirect.pl?id=1230

(imported comment written by JackCoates91)

Hi,

Out of curiosity, why are you doing it this way instead of using prefetch?

(imported comment written by bendernet91)

Unsure about this prefetch. Read some stuff about high cpu and such. I would like to copy the directory that contains the ietab2 contents from a share point to the extensions dir. {{ did not work. I can copy a single file.

1 Like

(imported comment written by SystemAdmin)

How about…

waithidden c:\windows\system32\cmd.exe /C copy /Y “\vm-redbirch\IETab2{{1BC9BA34-1EED-42ca-A505-6D2F1A935BBB}*.*” “C:\Program Files\Mozilla Firefox\extensions”

-Paul

(imported comment written by bendernet91)

Paul,

Did not work but thanks. Here is what I did to get this to work. Created a before and after snapshot executable using (old school) SMS Installer of the copy job. Created a fixlet called IETab2 using the distribution wizard. Copied that code to the tail end of my Firefox fixlet.

waithidden cmd /c rd /q /s “C:\Program Files\Mozilla Firefox\extensions{{77b819fa-95ad-4f2c-ac7c-486b356188a9}”

download http://servershare/Uploads/c38332e8068454794fd0e1af378114d3278e2e6f/Copyaddonexe.tmp

continue if {(size of it = 435859 AND sha1 of it = “c38332e8068454794fd0e1af378114d3278e2e6f”) of file “Copyaddonexe.tmp” of folder “__Download”}

extract CopyaddonEXE.tmp

wait __Download\Copyaddon.exe /s

It Works!

Steve

(imported comment written by SystemAdmin)

Btw, when you use CMD.exe, you shouldn’t need to put the whole path to it.

waithidden cmd.exe

(blablabla) should work fine too.

Paul

(imported comment written by bendernet91)

Paul,

Your right, thanks!

Steve

(imported comment written by koi9991)

bendernet

I set up the null session share and it was able to copy a file for testing purposes. However, cannot get this directory to copyits contents…

waithidden c:\windows\system32\cmd.exe /C copy /Y “\servershare\IETab2{1BC9BA34-1EED-42ca-A505-6D2F1A935BBB}” “C:\Program Files\Mozilla Firefox\extensions”

Bigfix can’t perform a simple task like this. It takes a lot more time than a sneakernet. Pay more money on the license fees and spend more time on the simple task. Sounds not right. I have the same issues.

(imported comment written by JackCoates91)

Could just zip the directory, which will have better performance anyway… though still worse performance and security than using BigFix as it’s intended. Using null session shares means no bandwidth control. The software distribution wizard is a pretty effective way to build a Fixlet that will get software to a machine and execute it.

(imported comment written by JackCoates91)

Hi,

we’ve just released the new Software Distribution tool, which should make this sort of task even easier to automate. Please see the forum post here: http://forum.bigfix.com/viewtopic.php?pid=27181#27181

thanks,

Jack

It is usefull software for copy, delete, long path files.
Please try “Long Path Tool” program.

Can you please expand your answer and provide more context? Example command line usage? The Publisher? Links to webpages about the tool and why it is useful?

This seems off topic and like spam because it is such a short answer to a very old post, which is why I flagged it as spam previously.