Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: Copy Files Using VbScript

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: Copy Files Using VbScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: Copy Files Using VbScript - 2/25/2007 8:25:00 AM   
  maksim

 

Posts: 7
Score: 0
Joined: 2/20/2007
Status: offline
THANK YOU. WORKED PERFECTLY, THANK YOU. Should add it to the windows scheduler and it will be perfect.

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 21
 
 RE: Copy Files Using VbScript - 11/6/2007 1:00:25 AM   
  mcseramana

 

Posts: 19
Score: 0
Joined: 7/18/2007
Status: offline
Hi Below code fine But when i use remote system how can use """"strComputer = "1.0.1.12" """" how can use this its giving Permission deniod:getObject, how can i monitor  remote system ?????? any idea ......


Thank's


*******************************************
strComputer = "." 'Local Computer running on this script
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:" _
   & "{impersonationLevel=impersonate}!\\" & _
       strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
   ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _
       & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
           & "TargetInstance.GroupComponent= " _
               & "'Win32_Directory.Name=""c:\\\\scripts""'") 'Monitor the files in Script Folder in C dirve
Do
   Set objLatestEvent = colMonitoredEvents.NextEvent
'  WScript.Echo objLatestEvent.TargetInstance.PartComponent   
'Copying the files to Destination Folder
    strFile = objLatestEvent.TargetInstance.PartComponent
    strFile = Replace(Mid(strFile, InStr(strFile, Chr(34)) + 1), "\\", "\")
    strFile = Left(strFile, Len(strFile) - 1)
    objFSO.CopyFile strFile, "C:\FolderB\"
   
Loop

(in reply to ashok_ganeshs)
 
 
Post #: 22
 
 RE: Copy Files Using VbScript - 11/6/2007 1:38:39 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
stop creating posts everywhere for the same question.
Did the answer here http://www.visualbasicscript.com/m_53270/tm.htm not help.
If not then say why it's not working. or that you dont understand the comments.
I tested the script I posted and it worked in my enviroment.

(in reply to mcseramana)
 
 
Post #: 23
 
 RE: Copy Files Using VbScript - 11/6/2007 1:47:59 AM   
  mcseramana

 

Posts: 19
Score: 0
Joined: 7/18/2007
Status: offline
Hi Below code fine But when i use remote system how can use """"strComputer = "1.0.1.12" """" how can use this its giving Permission deniod:getObject, how can i monitor  remote system ?????? any idea ......


Thank's

(in reply to ashok_ganeshs)
 
 
Post #: 24
 
 
Page:  <<   < prev  1 [2]
 
  

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: Copy Files Using VbScript Page: <<   < prev  1 [2]
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