Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: I need help, please help,

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,56229
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: I need help, please help,
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 2 [3]
Login
Message << Older Topic   Newer Topic >>
 RE: I need help, please help, - 2/5/2008 9:28:29 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
Here is a Backup to USB stick, I created/modified. Maybe you can take somthing from it.


      

_____________________________

"You start coding. I'll go find out what they want."

(in reply to dmp_92)
 
 
Post #: 41
 
 RE: I need help, please help, - 2/6/2008 1:35:41 AM   
  dmp_92

 

Posts: 70
Score: 0
Joined: 2/1/2008
Status: offline
One last question for you guys.  The code I have that copies over the files is base if the files are less then an hour old.  What if I just want to copy the files on what is more current?

This is the code I have


For Each file in objFolderA.Files
   If dateDiff("d", file.DateCreated, Date) < 2 Then 'copy file if it's "2 days old"
          'MsgBox "objFSO.CopyFile " & file.Path & ", " & UsbKey
        objFSO.CopyFile file.Path, UsbKey
   End If

(in reply to gdewrance)
 
 
Post #: 42
 
 RE: I need help, please help, - 2/6/2008 1:45:48 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
something like this

For Each file in objFolderA.Files
  If DateDiff("n", file.DateLastModified, Now) =< 60 Then
   objFSO.CopyFile file.Path, UsbKey
  End If

_____________________________

"You start coding. I'll go find out what they want."

(in reply to dmp_92)
 
 
Post #: 43
 
 RE: I need help, please help, - 2/6/2008 2:46:40 AM   
  dmp_92

 

Posts: 70
Score: 0
Joined: 2/1/2008
Status: offline
That's great.

Thanks,

(in reply to gdewrance)
 
 
Post #: 44
 
 RE: I need help, please help, - 2/15/2008 3:09:04 AM   
  dmp_92

 

Posts: 70
Score: 0
Joined: 2/1/2008
Status: offline
I need to make a slight change to the script.  I will post the first section. 


Option Explicit
'Dim objWMIService, objItem, colItems
Dim strComputer, strMbox, ArrDriveType, WMI, coldisks, disk, strtype, strID, strSys, UsbKey, file, USBFound
Dim objFSO:Set objFSO=CreateObject("Scripting.FileSystemObject")
Dim objFolderA: Set objFolderA=objFSO.GetFolder("\\bluewater\departments$\Information Technology\test\")


'****************** check to see if the files are more current ************************************************

' For Each file in objFolderA.Files
' Check for reg key "here"
' if no reg key found on computer then continue with script
' if reg key is more current then file then
' WScript.Quit 



'**************************************************************************************************************

The last part of the script that needs  to be modified is this


'***********************************  Change this section to just copy all current files and place a reg key somewhere on the PC  ***********

For Each file in objFolderA.Files
   If DateDiff("n", file.DateLastModified, Now) =< 60 Then
          objFSO.CopyFile file.Path, UsbKey
   End If

' after files are copied over create msg box to say that all files have been copied over succesfully ********************
'************************************************************************************************************************

(in reply to dmp_92)
 
 
Post #: 45
 
 RE: I need help, please help, - 2/15/2008 3:11:39 AM   
  dmp_92

 

Posts: 70
Score: 0
Joined: 2/1/2008
Status: offline
The reg key that gets placed on the computer should be a date stamp.  If this possible I do not even know.

(in reply to dmp_92)
 
 
Post #: 46
 
 
Page:  <<   < prev  1 2 [3]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: I need help, please help, Page: <<   < prev  1 2 [3]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts