Hi: can somebody assist me in this one?
How can I made an automated macro to search for files created TODAY on certain Windows Network folder shares? ie: \\servername\share$
thanks
search for files created today
Moderators: Dorian (MJT support), JRL
get list of files created today
There are at least a couple of ways to do this..... Here is one way
[code]
//mydir can be in UNC or regular windows folder format
Let>mydir=\\127.0.0.1\C
//Let>mydir=C:\temp\
Day>dd
Month>mm
Year>yyyy
Let>mydate=%mm%/%dd%/%yyyy%
Let>RP_WAIT=1
//If you want to search subdirectories also add the /s parameter
//Run>cmd /c dir %mydir% /s | find "%mydate%" >%TEMP_DIR%\temp_file_list.txt
Run>cmd /c dir %mydir% | find "%mydate%" >%TEMP_DIR%\temp_file_list.txt
ReadFile>%TEMP_DIR%\temp_file_list.txt,filelist
MessageModal>filelist
[/code]
[code]
//mydir can be in UNC or regular windows folder format
Let>mydir=\\127.0.0.1\C
//Let>mydir=C:\temp\
Day>dd
Month>mm
Year>yyyy
Let>mydate=%mm%/%dd%/%yyyy%
Let>RP_WAIT=1
//If you want to search subdirectories also add the /s parameter
//Run>cmd /c dir %mydir% /s | find "%mydate%" >%TEMP_DIR%\temp_file_list.txt
Run>cmd /c dir %mydir% | find "%mydate%" >%TEMP_DIR%\temp_file_list.txt
ReadFile>%TEMP_DIR%\temp_file_list.txt,filelist
MessageModal>filelist
[/code]
Last edited by adroege on Fri Jun 04, 2010 2:22 am, edited 3 times in total.
GetFileList doesn't do UNC paths
Here is another method, but it doesn't work with UNC paths, so using the DOS dir command seems like it's the better method.
[code]
Day>dd
Month>mm
Year>yyyy
Let>Today=%yyyy%%mm%%dd%
Let>file_list=
//This method doesn't work with UNC paths
//Let>mydir=\\127.0.0.1\C
Let>mydir=C:\*.*
GetFileList>mydir,files
Separate>files,;,file_names
If>file_names_count>0
Let>k=0
Repeat>k
Let>k=k+1
FileDate>file_names_%k%,dFileDate
Let>today_file=file_names_%k%
If>dFileDate=%Today%
ConCat>file_list,%today_file% %CRLF%
Endif
Until>k,file_names_count
Endif
MessageModal>file_list
[/code]
[code]
Day>dd
Month>mm
Year>yyyy
Let>Today=%yyyy%%mm%%dd%
Let>file_list=
//This method doesn't work with UNC paths
//Let>mydir=\\127.0.0.1\C
Let>mydir=C:\*.*
GetFileList>mydir,files
Separate>files,;,file_names
If>file_names_count>0
Let>k=0
Repeat>k
Let>k=k+1
FileDate>file_names_%k%,dFileDate
Let>today_file=file_names_%k%
If>dFileDate=%Today%
ConCat>file_list,%today_file% %CRLF%
Endif
Until>k,file_names_count
Endif
MessageModal>file_list
[/code]