Copy the file from one location to network drive

Hi, i am trying to copy a file one location to other network location with the below command but it is not copying the file,

is it what i am using correctly? or we can have any other option to do that?

waithidden __Download\RunAsCurrentUser-2.0.3.1.exe dos copy c:\temp\{parameter "outfile"} \\server1\e$\IEM_Action_History\IEM_PATCH_REPORT\Date.xml

Hi,

Just upload the source file and deploy (or) Paste the file to all the endpoints.

ohk , actually i am generating the xml file with the help of a script inside a bigfix action script and want to copy it to share location

once i generate the xml file than how to upload to BF server?

source file in only one (or) many based on all endpoints?
because one source file (xml) mean use software deployment for uploading purposes then use copy command in the directory.

Ok, is it possible to use some command for upload in the same / single bigfix script to Uploads folder?

go to -->wizard–>windows software dist wizard–>upload the xml file and use copy command.

I understood what you trying to explain , but problem is that i have a bigfix script that dynamically create xml file or files , so i have no fix names . I want to copy the dynamically generated files into share drive.

If i go to s/w wizard it will take extra time and effort and i guess i need to create two script one for generation and other for upload.

Sorry if i mis-understood

1 Like

sorry, is this below link may be help you,
http://www.ibm.com/support/knowledgecenter/SS63NW_9.2.0/com.ibm.tivoli.tem.doc_9.2/Platform/Config/c_examples.html

Ok, i checked the link i upload the file on BES Server at the below location but unable to download the file from this location?

c:\Program Files (x86)\BigFix Enterprise\BES Server\UploadManagerData\BufferDir\sha1

If you want to copy a file to a network share with bes client, you must start bes client service with a domain user who has write access for target share directory.

Starting the client as a user removes a TON of capabilities out of the agent so this is never recommended.

2 Likes

Hi @AlanM

Can you please help me to write a code or settings files or folder from bigfix script to shared location?

Thanks

You could use secure parameters to connect the drive with a user/password but unless the UNC share is open to all for writing/reading then it would not be able to be connected to by a service running as LOCAL SYSTEM

how to use this secure parameters in BF action script, i know normal parameter query command

Take a loot at this example:

https://bigfix.me/fixlet/details/3678

1 Like

I want to use the secret parameter as below but it is not prompting me to enter password value?

dos net user adminstrator {parameter “secret” of action}

dos net use V: \server1\Action_History {parameter “secret” of action} /user:domain\user /persistent:no
copy c:\temp\AgentRestart-2dec.csv V:\action_history\AgentRestart-2dec.csv
dos net use /delete /y v:

Hi,

The easiest way to do this is to create a Windows File Share and provide, “Domain Computers” write access to the share.

Adding Domain Computers lets the System account access the share (the bigfix agent runs as the System account).

Then you can just copy directly to the share without mapping it or requiring credentials.

1 Like

Hi, i did not get how to add domain computers to provide write access? However i have added local system and domain systems account to write access but still unable to copy the file to the shared folder

It seems like you are trying to get the results of a script that outputs XML from one or many clients.

You could write relevance to pull back the parts of the file you need as results into an analysis property.

You could also use the Upload manager to upload files from the client to the root server, but you would need access to the root server to get the results, and I wouldn’t recommend overdoing this. It is not a bad option for random troubleshooting, but it isn’t great to use a lot on every client.

i found the solution for copy files and below is the working script for me from the copy part

download http://appserver:52311/Uploads/stage/RunAsCurrentUser-2.0.3.1.exe
// copying the xml and csv files to the network location i.e. \server1
delete vjcopy.cmd
delete “c:\temp\vjcopy.cmd"
createfile until @end_create_copy_file
c:
cd c:\temp
SET mydir1=”\server\IEM_Action_History\IEM_PATCH_REPORT"

copy /y c:\temp{parameter “outfile”} c:\temp\RawData.xml

xcopy /y c:\temp\RawData.xml %mydir1%

SET mydate=“p13_%date:~-4,4%%date:~-10,2%%date:~7,2%”

SET mydir2="\server1\h$\IEM_PATCH_REPORT_BACKUP%mydate%"

mkdir \server1\h$\IEM_PATCH_REPORT_BACKUP%mydate%

xcopy /y c:\temp{parameter “csv_outfile”} %mydir2%
xcopy /y c:\temp{parameter “outfile”} %mydir2%

@end_create_copy_file
move __createfile vjcopy.cmd
copy vjcopy.cmd “c:\temp\vjcopy.cmd”

wait __Download/RunAsCurrentUser-2.0.3.1.exe --w cmd.exe /C c:\temp\vjcopy.cmd