Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Problem based on Script

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Problem based on Script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Problem based on Script - 2/21/2007 2:02:48 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
Hi All,

==========================================================================
' NAME: WMI_Copy_Prod2Blade.vbs
' AUTHOR:Your Name
' DATE  :
' COMMENT: This Code copy files from Production folder to Blade folder,whenever new file is added in to Production Foler
''==========================================================================
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

I got a very weird error after running this scrip on one of our Biztalk Server.

After ran this script look like it changed the credential settings on that box so am not able to connect that server from any other servers.

Now i got a problem to get in to that server itself...

Appreciate all your suggestions.

Thanks in Advance

Ashok
 
 
Post #: 1
 
 RE: Problem based on Script - 2/21/2007 2:11:05 AM   
  DiGiTAL.SkReAM


Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
I see nothing that would change credentials.

However, is it possible that the script just went into an infinite loop via your DO...LOOP?


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ashok_ganeshs)
 
 
Post #: 2
 
 RE: Problem based on Script - 2/21/2007 2:21:38 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
Thanks for your reply...

It might be true but i killed that process immediately after i tested that script on that box,so there is no reason "Do...Loop" can cause this.

Thanks
Ashok

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 3
 
 RE: Problem based on Script - 2/21/2007 2:22:18 AM   
  dm_4ever


Posts: 2433
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
I agree with DiGiTAL.SkReAM. You may just put a WScript.Sleep  in your Do...Loop for maybe 5 seconds.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 4
 
 RE: Problem based on Script - 2/21/2007 2:35:10 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
okie...if i go with your words

i ran the same script on my machine also but it doesn't make any problem yet...why its on that server ?

that's why i feel very weird about this.

Thanks
Ashok

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: Problem based on Script - 2/21/2007 2:37:05 AM   
  DiGiTAL.SkReAM


Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Personally, I think that it has less to do with that script, per se, and more to do with the possibility of a flaky WMI on that server.
Or, and this has beenknown to happen, something else messed things up at about the same time as that script ran.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ashok_ganeshs)
 
 
Post #: 6
 
 RE: Problem based on Script - 2/21/2007 2:43:43 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
first i thought in that way, after google it i found

http://www.scriptinganswers.com/archive/articles/Newinscriptingandgotissuewithsecurity.htm

those things ensure this might happend based on the script...thats why

Thanks
Ashok

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 7
 
 RE: Problem based on Script - 2/21/2007 3:34:57 AM   
  DiGiTAL.SkReAM


Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
The fact remains, you do not reference anything IN your script that could change any of the credentials on your machine.



_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ashok_ganeshs)
 
 
Post #: 8
 
 RE: Problem based on Script - 2/21/2007 5:51:39 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
Digital,

Can you explain little bit more for this small brain,where i did mistake ?

Thaks
Ashok

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 9
 
 RE: Problem based on Script - 2/21/2007 9:41:55 AM   
  Parabellum


Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
what he's saying is there's nothing to do with the wmi credentials in the original code that would cause this error.
the link you posted is relating to scripts not having access or correct credentials to connect toremote machines, nothing to do with machines not communicating after running the script.
Im inclined to agree with dm_4ever and DiGiTAL.SkReAM  it's more likely to be your loop crashing something or problem with the WMI on server.
you could check the processor and memory usage when you run the script, and see if anything peaks...(for wscript.exe)
also take dm's advice and put a sleep command in the loop so that it runs every 5 sec... (or more!!)

(in reply to ashok_ganeshs)
 
 
Post #: 10
 
 RE: Problem based on Script - 2/22/2007 1:16:41 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
I checked the mem usage it was 4000K.

Anyway its totally screwed up,so we reinstalled OS and restored from backup but its really embarrasing me not to find the cause and rectify.

Thanks for all your support.

Ashok

(in reply to Parabellum)
 
 
Post #: 11
 
 RE: Problem based on Script - 2/22/2007 4:11:08 AM   
  DiGiTAL.SkReAM


Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Well, at least you KNOW for a fact that it had nothing to do with the script that you ran.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ashok_ganeshs)
 
 
Post #: 12
 
 
 
  

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 >> Problem based on Script Page: [1]
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