kdjonesmtb2
Technical User
Hello
I have a script that is generating the follwoing error when it tries to move .X12 files to an archive folder
File name example
qtptest1.X12
File already exists
Line (96): "fso.MoveFile f1,target".
However the Target archive folder does not have any files in it.
Thanks
If objRadioButton1.checked then
msgbox "You have selected the option to archive all text files"
Set fso=CreateObject("Scripting.FileSystemObject")
sour="\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Text files"
target="\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Archive"
Set fldr=fso.getFolder(sour)
for each file in fldr.files
if right(lcase(file.name),4)=".x12" then
call mover(lcase(file.path))
end if
next
sub mover(f1)
f2=replace(f1,"pdf","X12")
if fso.fileExists(f2) then
fso.MoveFile f1,target
fso.MoveFile f2,target
wscript.sleep 60000
end if
end sub
End if
I have a script that is generating the follwoing error when it tries to move .X12 files to an archive folder
File name example
qtptest1.X12
File already exists
Line (96): "fso.MoveFile f1,target".
However the Target archive folder does not have any files in it.
Thanks
If objRadioButton1.checked then
msgbox "You have selected the option to archive all text files"
Set fso=CreateObject("Scripting.FileSystemObject")
sour="\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Text files"
target="\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Archive"
Set fldr=fso.getFolder(sour)
for each file in fldr.files
if right(lcase(file.name),4)=".x12" then
call mover(lcase(file.path))
end if
next
sub mover(f1)
f2=replace(f1,"pdf","X12")
if fso.fileExists(f2) then
fso.MoveFile f1,target
fso.MoveFile f2,target
wscript.sleep 60000
end if
end sub
End if