Jump to content
Sign in to follow this  
utaeladil

Help creating a script to copy text files to clipboard

Recommended Posts

utaeladil

I am trying to think of the easiest way to create a script or batch file that would take 3 or 4 text files and copy them all to a single text file (and then also copy the contents of that single text file to the clipboard).

This will be used to collect logs from about 3 or 4 different spyware scanners we use at work.

Almost all of the text files are always going to be in the same location and have the same name, except for logs from one of our tools. Those logs are always in the same folder, but it auto generates a name based on the date and time it was created. If the script could be told which folder that one logfile is located that changes, but have it only grab all logfiles with todays date (and nothing earlier) that would probably do it.

I know that I could do almost all of this with a simple .bat file, but I am having trouble on the logfiles that change... but then I realized I don't want it to give all logs and only ones from today, I thought it may be easier to do this in AUTOIT...

Unfortunately, I do not have enough experience with AUTOIT myself, I've only written one small tool but it does seem to work well, but this would be beyond my current skill set and I would like to get something put together for the next few days.

-----

The entire script could have some sort of "clause" in it at the beginning that tells it to only get files created on todays date (or maybe todays and yesterdays), and then give me 2 or 3 lines that I could hard code for the non changing filenames, and then give me a place to put in a folder (but no filename) for the one folder that will have files that change, then just dump all of them to a specified text file and copy it to the clipboard, that should do it...

Any help or examples are GREATLY appreciated!

Thanks!

Share this post


Link to post
Share on other sites
Zisly

$file1=FileRead('file1.txt')
$file2=FileRead('file2.txt')
$file3=FileRead('file3.txt')
$file4=FileRead('file4.txt')

$new_text=$file1&$file2&$file3&$file4

$newfile=FileOpen("new_file.txt",2+8)
FileWrite($newfile,$new_text)
ClipPut($new_text)
FileClose($newfile)

Edit; Didn't read the whole first post, I'll do so now and see what I can do :D

Edit2; Will take to long time for me making this (got own projects)

But check out

_GetExtProperty

RecursiveFileSearch

Those functions are a must for this :D

Edited by Zisly

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.