mrforgetful Posted February 26, 2008 Posted February 26, 2008 We use AB Tutor to log computer activity. I would like to copy these logs to a folder on the server when the user logs off. Now all the computers name the files by their date ie 20080215.blg This means I need to rename the file to the computer name aswell as copy it, or create a subfolder with the computer name. Any ideas? Or do I just tell people logs are lost when the computer is imaged, as current practice.
Jona Posted February 26, 2008 Posted February 26, 2008 Sounds fairly simple with a batch script and scheduled task. On my machine I have a enviroment variable called COMPUTERNAME which I can see by doing echo %COMPUTERNAME%. I'm not sure if this is their by default (perhaphs someone else can confirm). This combined with xcopy to a UNC path should do the job..... Schedule to run as often as you need or just run manually before you image the machine. Cheers Jona
mrforgetful Posted February 26, 2008 Author Posted February 26, 2008 I'm a numpty when it comes to coding...
Jona Posted February 26, 2008 Posted February 26, 2008 well bat files are just a list of dos commands so hardly even coding. You'd want something *like* xcopy /E /v /c /y sourcedrive:\sourcefolder\ \\servername\writableshare\%computername%\ Cheers Jona 1
mrforgetful Posted February 26, 2008 Author Posted February 26, 2008 My God that is simple! Cheers Jona. I've used scripts to copy stuff before but usally from the server. I had no idea you could just put %COMPUTERNAME% and it would automatically do that.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now