Hi Guys,
Of all the functions in Macro Scheduler I have challenges with this one the most. Sometimes it works and sometimes it simply does not. When I run the script below, it copies all the data and subfolders to the destination folder. The script works great. But if the CD has a lot of data I get the Script Control message. Once the function completes the control message goes away. So even when the error is generated the script still works. If the CD data is cached it only takes a couple of seconds and there is no error message. I have read several post (including my own) and Im not sure why its not working. Im running MSched 7.3.11 on w2k. Here is the script:
Let>VBS_TIMEOUT=10000
VBSTART
destfolder = "CDCount\"
Dim filesys, oFolder, srcfolder, tgtfolder, oFile, objFolder
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("C") Then
tgtfolder = "C:\"
End If
If fso.FileExists("D") Then
tgtfolder = "D:\"
End If
If fso.FileExists("E") Then
tgtfolder = "E:\"
End If
If fso.FileExists("F") Then
tgtfolder = "F:\"
End If
If fso.FileExists("G") Then
tgtfolder = "G:\"
End If
If fso.FileExists("H") Then
tgtfolder = "H:\"
End If
If fso.FileExists("I") Then
tgtfolder = "I:\"
End If
If fso.FileExists("J") Then
tgtfolder = "J:\"
End If
If fso.FileExists("K") Then
tgtfolder = "K:\"
End If
If fso.FileExists("L") Then
tgtfolder = "L:\"
End If
If fso.FileExists("M") Then
tgtfolder = "M:\"
End If
If fso.FileExists("N") Then
tgtfolder = "N:\"
End If
If fso.FileExists("O") Then
tgtfolder = "O:\"
End If
If fso.FileExists("P") Then
tgtfolder = "P:\"
End If
If fso.FileExists("Q") Then
tgtfolder = "Q:\"
End If
If fso.FileExists("R") Then
tgtfolder = "R:\"
End If
If fso.FileExists("S") Then
tgtfolder = "S:\"
End If
If fso.FileExists("T") Then
tgtfolder = "T:\"
End If
If fso.FileExists("U") Then
tgtfolder = "U:\"
End If
If fso.FileExists("V") Then
tgtfolder = "V:\"
End If
If fso.FileExists("W") Then
tgtfolder = "W:\"
End If
If fso.FileExists("X") Then
tgtfolder = "X:\"
End If
If fso.FileExists("Y") Then
tgtfolder = "Y:\"
End If
If fso.FileExists("Z") Then
tgtfolder = "Z:\"
End If
on Error Resume Next
fso.CopyFolder tgtfolder & "BackTemp\*.*", destfolder
VBEND
Exit
VBS_TIMEOUT ...again
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 58
- Joined: Thu Oct 16, 2003 12:53 am
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
What was the problem?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 58
- Joined: Thu Oct 16, 2003 12:53 am
the problem was...
Hi mtettmar
The problem was me writing code at 3 in the morning:
The help clearly states by default a VBScript never times out. I was trying to set a time out based on the size of CD data. and getting frustrated when the time out was not long enough.
The problem was me writing code at 3 in the morning:
The help clearly states by default a VBScript never times out. I was trying to set a time out based on the size of CD data. and getting frustrated when the time out was not long enough.