(imported topic written by TJessee)
Good afternoon.
I am writing a fixlet for my Infosec folks and I am trying to run more of it using Relevance and the appendfile command. This script is as follows
delete
c:%computername%-troubleshoot.txt
delete
__appendfile
appendfile
appendfile
********** Netstat **********
appendfile
{concatenation “%0d%0a” of (it as string) of ((if udp of it then “UDP” else “TCP”),local address of it as string | “No Local”, local port of it as string | “No Local Port”, remote address of it as string | “No Remote”, remote port of it as string | “No Remote Port”,(if (exists tcp state of it) then (tcp state of it as string) else (“No State”)) ) of sockets of network}
appendfile
********** Scheduled Tasks **********
appendfile
{concatenation “%0d%0a” of (it as string) of (names of it, enabled of it, path of it, next run time of it as string|“no run time”, (if ready state of it then “ready” else if queued state of it then “queued” else “Unknown State”)) of scheduled tasks}
appendfile
********** Tasks List **********
appendfile
{concatenation “%0d%0a” of (it as string) of (names of it, pids of it, session ids of it) of processes}
copy __appendfile
{computer name}
-troubleshoot.txt
move
{computer name}
-troubleshoot.txt “C:”
It runs everything fine up to the Move. When it trys to do the move it errors our with the following statement
Command succeeded copy __appendfile MJKGGBG-troubleshoot.txt (action:11760)
At 14:11:59 -0400 -
Retry error, attempt 8 failed for MoveFile (C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_InfoSec\MJKGGBG-troubleshoot.txt, C:)
At 14:11:59 -0400 - actionsite (
http://BIGFIX:52311/cgi-bin/bfgather.exe/actionsite
)
Command failed (Move of ‘C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_InfoSec\MJKGGBG-troubleshoot.txt’ to ‘C:’ failed (0)) move MJKGGBG-troubleshoot.txt “C:” (action:11760)
I need to be able to move the file from the location it is at to another location so I can grab it and move it to a location the InfoSec folks have access too.
I have created this in a batch file and it works perfect
delete "c:%computername%-troubleshoot.txt"
delete __createfile
createfile until
echo ******task list****** >> c:\%computername%-troubleshoot.txt
tasklist >> c:\%computername%-troubleshoot.txt
echo ******sch list****** >> c:\%computername%-troubleshoot.txt
schtasks >> c:\%computername%-troubleshoot.txt
copy __createfile run.bat
waithidden run.bat
Any help is greatly appreciated. I have tried every combination fo the move to make this work and I am now stuck. Thanks.
Troy