Deze code werkte vorige week vrijdag wel, maar nu niet meer. Ik heb het geprobeerd met Viual Basic 6 om het op te lossen. Het bestand heb ik gekoppeld aan de Wscript.exe, maar werkt ook niet. Zelfs als ik de paden veranderd, geeft het geen melding.
Dit programma draait op eenn Windows 2000 +SP4 en Visual Webtask 4.
Deze script heb ik ook geprobeerd met een ander machine met Windows XP Pro.
Dit programma draait op eenn Windows 2000 +SP4 en Visual Webtask 4.
Deze script heb ik ook geprobeerd met een ander machine met Windows XP Pro.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
| dim sf,x,par
dim WshShell
dim PathToSpider
dim PathToVWT,workDirectory
dim counter,outputFileVWT,outputFile
counter = 0
Set WshShell = CreateObject("WScript.Shell")
Set par = WScript.CreateObject("Scripting.Dictionary")
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
PathToSpider = "C:\PROGRA~1\LENCOM~1\VISUAL~1\Spider.exe" 'path to Spider.exe
PathToVWT = "C:\FUNDAS~1\OPDRAC~1\test.vwt" 'path to .vwt
outputFileVWT = "C:\FUNDAS~1\OPDRAC~1\test.txt" 'file output
outputFile = "C:\FUNDAS~1\EINDRE~1\test.txt" 'target file
workDirectory = "C:\FUNDAS~1\temp"
Dim currentParams
Sub Runtask()
dim k,v,i,pp,na
pp = ""
k = par.Keys
v = par.items
for i=0 to par.count-1
pp = pp & " /parameter/" & k(i) & "/" & v(i)
next
na = workDirectory & "\L_" & Replace(currentParams,"%","") & ".txt"
if fs.FileExists (na) then
exit sub '''''''''''''''''if file exists not to repeat task
end if
if fs.FileExists (outputFileVWT) then
fs.DeleteFile outputFileVWT
end if
WshShell.run PathToSpider & " " & PathToVWT & " /finishOnDone" & pp, , True
if fs.FileExists (outputFileVWT) then
counter = counter +1
fs.CopyFile outputFileVWT ,na,True
if fs.FileExists (na) then
WshShell.run "cmd /C copy " & workDirectory & "\L_*.txt " & outputFile,7,True
end if
fs.DeleteFile outputFileVWT
end if
End Sub
par.RemoveAll
par.Add "plaatspostcode","1000"
currentParams = "1000"
Runtask |