dbTalk Databases Forums  

VBScript Loop goes too quick

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss VBScript Loop goes too quick in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default VBScript Loop goes too quick - 06-12-2006 , 03:00 PM






I have a script with this code in it:

For Each objSc in objXml.DocumentElement.ChildNodes
strUrl = objSc.Attributes.GetNamedItem("Url").Text
strFileName = "G:\backup\Migrate\" & Replace(Replace(strUrl,
"http://", ""), "/", "_") & _
".fwp"
strCmd = Migrate_Path & " -w """ + strUrl + """ -f """ +
strFileName + """ -y -u * -pw *
'WScript.Echo "Backing up site collection with Migrate tool" &
strUrl & " to file " & strFileName & " using the following command " &
strCmd
objShell.Exec(strCmd)

The script goes too fast, it calls the command for all objects and
creates errors. In testing I found that the command that runs with the
first Object needs to finnish before the second command can begin.

I'm very new to scripting and would love to know if there is a way I
can set it to run the strCmd only after the first instance is done.

Right now I am using the WScript.Echo line to slow it down but I have
to be here to click OK eachtime.

Please help!


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: VBScript Loop goes too quick - 06-17-2006 , 09:46 AM






Hello jstgod (AT) hotmail (DOT) com,

You might want to go to a different NG (XML, Scripting, .Net). This newsgroup
is primarily dealing with DTS.

Allan


Quote:
I have a script with this code in it:

For Each objSc in objXml.DocumentElement.ChildNodes
strUrl = objSc.Attributes.GetNamedItem("Url").Text
strFileName = "G:\backup\Migrate\" & Replace(Replace(strUrl,
"http://", ""), "/", "_") & _
".fwp"
strCmd = Migrate_Path & " -w """ + strUrl + """ -f """ +
strFileName + """ -y -u * -pw *
'WScript.Echo "Backing up site collection with Migrate tool" &
strUrl & " to file " & strFileName & " using the following command " &
strCmd
objShell.Exec(strCmd)
The script goes too fast, it calls the command for all objects and
creates errors. In testing I found that the command that runs with the
first Object needs to finnish before the second command can begin.

I'm very new to scripting and would love to know if there is a way I
can set it to run the strCmd only after the first instance is done.

Right now I am using the WScript.Echo line to slow it down but I have
to be here to click OK eachtime.

Please help!




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.