Jump to content

grnslv

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by grnslv

  1. hmm ok. so this is what i have prepared for "showtime" sRoot="c:\" sCheckDate="|2010-06-15|2010-06-14|2010-06-13|2010-06-12|2010-06-11|2010-06-10|" set oFSO=createobject("scripting.filesystemobject") set oFolder=ofso.getfolder(sRoot) for each oFile in oFolder.Files sDate=ShowDate(oFile.datecreated) if instr(sCheckDate,sDate)<>0 then ofile.delete, true end if next Function ShowDate(d) ShowDate=year(d)& "-" & right("0" & month(d),2) & "-" & right("0" & day(d),2) end function is that correct? when i try to run it i get the following error http://img252.imageshack.us/img252/2863/err.png did i do something wrong? oh and yes... i am american lol. good observation. =-)
  2. srochford! thank you SO much for that script. it worked like a champ. i added it to the "run these programs on logon" in my group policy. works works works! thanks. now on to part two. how would i go about deleting files at the root of my c:\ drive that were placed there by a specific date and only if they are *.exe or *.file ? such as this http://img295.imageshack.us/img295/4391/vir.png as you can see, the highlighted files are either .file or .exe and they were (for the most part) modified/created on the same date. what kind of script would i need that would erase all files on the root of C:\ with the extensions of *.exe or *.file and were modified/created on 06/12/2010, 06/13/2010/ 06/14/2010, 06/15/2010? if you arent able to tell, im doing a bit of virus cleanup on my network. =(
  3. ok allow me to try to be a little more clear. What i am trying to accomplish is to deploy this batch file out to every computer on my network. every computer on my network has a folder that i need to copy a certain file to. the folder i want to copy my file to doesnt have a static name. the one thing this folder has static - is the creation date. now to break down the details. there is a directory located @ c:\documents and settings\all users\application data\microsoft\ that has a random name. the directory looks like c:\documents and settings\all users\application data\microsoft\asdfcewr\ or c:\documents and settings\all users\application data\microsoft\zxcbvcv\ I am wanting this file: c:\example.doc to be copied to that random directory. as you can see, i cannot do a command like xcopy c:\example c:\documents and settings\all users\application data\microsoft\asdfcaxv\ becuase the directory of "\asdfcaxv" is named differently on every computer on my network. This randomly named directory was created on 06/14/2010. this is true on EVERY computer on my network. SO is there a way i can copy my file - c:\example.doc - to that randomly named directory based on creation date? this is an example command that is NOT RIGHT - this is just to try to find some clarity to the situation. xcopy c:\example.doc c:\documents and settings\all users\application data\microsoft\ only-copy-to-folder-with-creation-date-of-06142010 and if the post above by srochford accomplishes this - then what do i do with his script? do i just copy and paste all of that into a .bat file and run it? or is that a .vb script? or what? lol. like i said..im pretty new to this whole thing.
  4. ok, i am a total noobie for the forums..so please be gentle =) what i am trying to accomplish is this... i want to write a simple batch file that copies a file located- c:\example.doc to any folder that has the creation date of 06/14/2010 in c:\documents and settings\all users\application data\microsoft\ i would just use the directory name instead of doing it by date created - but im trying to do this on 50+ computers and the directory name is never the same. the directory i am wanting to copy this file to is named differently on every computer. im sure this is easy for you guys...but im just completely lost on this one. =(
×
×
  • Create New...