[THIN] Re: OT: Batch file question

  • From: Mike_Niccum@xxxxxxxxxxxxxxx
  • To: thin@xxxxxxxxxxxxx
  • Date: Fri, 20 Dec 2002 17:47:17 -0600

Hello to all...I signed up for this list and here is my first post...

I know you said batch file, but here it is in vbscript (watch the line
wrap):

strOrgFolder="C:\folder1\"      'Be sure the variable has a trailing
backslash
strDestFolder="C:\folder2\"   'Be sure the variable has a trailing backslash

Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder(strOrgFolder)

For Each objFile In objFolder.Files
' the following line will copy files based on age, the -2 means copy all
files 2 days old and newer
'   If DateDiff("d", now, objFile.DateLastModified) > -2 then
      objFile.Copy strDestFolder & objFile.Name,true 'True = Overwrite,
False = Do Not Overwrite
      If err.number = 0 then
         objFileSys.DeleteFile objfile
      End If 
'   End If
Next

-----Original Message-----
From: Michael Boggan [mailto:MBoggan@xxxxxxxxxxx]
Sent: Friday, December 20, 2002 4:06 PM
To: THIN (E-mail)
Subject: [THIN] OT: Batch file question


I am trying to right a batch file that copies files from drives on local
harddrive to directories on a network share then, IF there are no errors,
deletes the files on the local harddrive.  How can I do the delete?  I got
that copy part, but how can I tell it to delete the files only if there are
no errors?  Any ideas?

Thanks,

--------------------------------------------
Michael Boggan, Network Eng/Citrix Admin
Virtual Desktop Inc.
Dallas, Tx
ph. (972) 960.6400
f. (972) 960.6445
email. mboggan@xxxxxxxxxxx
--------------------------------------------

*********************************************** 
This Weeks Sponsor: 99point9.com
The 99Point9.com Online Tech Support 
Helpdesk is the one-stop solution for all 
your server-based computing needs. 
http://www.99point9.com
************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm
*********************************************** 
This Weeks Sponsor: 99point9.com
The 99Point9.com Online Tech Support 
Helpdesk is the one-stop solution for all 
your server-based computing needs. 
http://www.99point9.com
************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm

Other related posts: