this has given me a headache all night tonight… can someone assist? here is the email i sent to support:
I am using the Software Distribution Wizard to deploy a batch files to Windows 2003 servers, both 32 and 64 bit. I can manually run the batch file on the local server, and it runs fine, when I use the wizard to deploy, it does not work all the way through…. Here is the context of the batch file:
I have added timeouts, changed “CASE settings”, used “quotes”, almost everything I can think of… it does the c:\sysedge\config delete and copy command, but it will not do the commands that happen to be using the C:\WINDOWS\system32 path. Can you look this over and give me some more advice or something else to try?
Of course I need to get this done ASAP… as we are trying to implement SMNP V3 before the weekend.
I believe the issue will be with the copy commands from the share folder… The BigFix Agent runs as the SYSTEM account and thus does not have access to the same shares that you as a user have…
Generally there are two ways to move forward with this:
Run the batch script as the currently logged in user using RunAsCurrentUser.exe tool found here:
Instead of copying the files from a share, add them to the software distribution wizard (put them in a folder and deploy them with the software distribution wizard and then add a few action script lines to copy the files). The lines you will add will look something like this:
// delete the files
delete c:\sysedge\config\sysedgeV3.cf
delete C:\WINDOWS\system32\sysedge.cf
delete C:\WINDOWS\system32\sysedge.mon
// copy the files from the __Download folder (they will be there after the extract is called) to the destination
copy __Download\sysedge.cf C:\WINDOWS\system32\sysedge.cf
copy __Download\sysedgeV3.cf c:\sysedge\config\sysedgeV3.cf
i see where your coming from… but i can get the copy command to work on the c:\sysedge\config directory just fine, but the del or copy command does not run/work on the c:\windows\system32, so to me, it seems like the copy command from the share is working ok, just not to he c:\windows\sysem32. I guess it could be a permission problem, but wouldnt the log tell me that? it states ran successfully… I looked into the runascurrentuser tool, how in the world does this work and where do i install it?
Unless your share is a null session share, then the copy won’t work.
To troubleshoot further, it would help if you posted your actionscript from the task you are trying to run, the batch file contents, and the log file from the agent… as well as what you see actually happen (which files being deleted? are they being copied?)
I have done some more testing…so here is the deal…
I can copy and delete files from everywhere on a windows server 2003 except from windows\system32… the custom task or software distribution wizard will not touch anything in sytem32… but it will in just the plain windows directory…
am i missing something here? runascurrentuser will not work for me… i need to make files deletes and copies to the windows\system32 folder, and i am not going to log into every server is have to make this happen.
is there anything else i can do? or am I out of luck?
the copies work from the share to the c:\sysedge\config folder but not to the c:\windows\system32, and here is the catch… the copy does work to c:\windows
Ah… that could be the issue because of the way that the OS handles the 32bit vs. 64bit parts of the file system…
So your script is probably working but it is copying the files to the 32-bit system32 folder (which is actually at a subfolder of the 64-bit system called syswow64)… I bet if you check there you will see your files… I believe that the actual folder of “C:\windows\system32” that you are looking at in explorer is the 64-bit version of the file system folder.
If you want to use that folder instead, you need to tell the client to stop using the wow64 redirection, so you would put the line at the top of the action: