Expl0de Posted May 24, 2010 Share Posted May 24, 2010 There's some basic file manipulation that I have to do at my job on a regular basis, so I decided to try my hand at scripting. I was having a bit of trouble, so I figured I'd come here :) It's just a simple .BAT. Objective:Delete old directory from the user's desktop (always ends in suffix *_Agenda)Copy new directory (changes weekly, format is Date_Agenda) to desktop.Open date_agenda folder, and start the date_agenda.docx file. Problems:copy X:\ command only copies files; it does not copy entire directories.The start command does not work, as it needs an exact filename to start and the filename changes weekly. Is there a way around this? @echo off echo Deleting old board files. del c:\users\board\desktop\*_Agenda echo Complete! echo Finding Directory.... cd X: dir X: echo Found directory, copying. Please wait. copy X:\date_agenda C:\users\board\desktop\ echo Completed copying. start c:\users\board\desktop\date_agenda\date_agenda.docx pause Link to comment Share on other sites More sharing options...
obfuscator Posted May 24, 2010 Share Posted May 24, 2010 Is the date format always the same? If you're running this file weekly it might be possible to grab the system date and figure out the folder name that way. "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti Link to comment Share on other sites More sharing options...
Expl0de Posted May 24, 2010 Author Share Posted May 24, 2010 yes, it goes, for example, 05.24.10_Agenda. How do I grab those specifics from the system, and not the time as well? Link to comment Share on other sites More sharing options...
obfuscator Posted May 24, 2010 Share Posted May 24, 2010 Hmm, ok, I'll try to find that out. What you want to do logic wise is grab the current date, append it to the _agenda file name, blah blah blah. http://en.kioskea.net/forum/affich-16514-batch-file-for-one-current-date-in-text-file This might help you. "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti Link to comment Share on other sites More sharing options...
Expl0de Posted May 24, 2010 Author Share Posted May 24, 2010 Hmm, ok, I'll try to find that out. What you want to do logic wise is grab the current date, append it to the _agenda file name, blah blah blah. http://en.kioskea.net/forum/affich-16514-batch-file-for-one-current-date-in-text-file This might help you. Thanks, it did. :) This saves SO much time. Link to comment Share on other sites More sharing options...
obfuscator Posted May 24, 2010 Share Posted May 24, 2010 No problem, glad you got it working :) If you want, I know there's a simple free batch to EXE converter out there somewhere :P Don't remember a name/url though. "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti Link to comment Share on other sites More sharing options...
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