|
I don’t see the need for a select case, but File.Exists would help. What I would do is something like this Dim moveName moveName = CurrentNameOfFile While TargetFolder.FileExists(currentNameofFile) currentNameOfFile = currentNameofFile + Cstr(Int(Rnd * 10000)) Wend ‘moveTheFile() Rnd*1000 will get you some random # 0 – 1000 int makes it an
integer and cstr makes it a string. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Kern I have this _vbscript_ i wrote/stole to move all files with an .eml
extension from many subdirs into a folder only if the folder is empty and
only to move 999 at a time. it works great except when it sees files with duplicate names it bombs
out while moving them. i'd like it to rename the dup(maybe add some random #'s or characters
to the end) and continune moving all the files. I think I have to use "FileExists" method and
"Select...Case" but I'm not sure how. Was wondering if anyone could help me with this. Here is the code- source="H:\tempxtender" Set fso =
CreateObject("Scripting.FileSystemObject") dim full do sub
folderlist(grp) sub
filelist(grp) My
aologies for bugging you guys with this OT. Thanks |
- RE: [ActiveDir] VBScript help(OT) Brian Desmond
- Re: [ActiveDir] VBScript help(OT) Tom Kern
- RE: [ActiveDir] VBScript help(OT) Brian Desmond
- RE: [ActiveDir] VBScript help(OT) Ken Schaefer
- Re: [ActiveDir] VBScript help(OT) Tom Kern
- RE: [ActiveDir] VBScript help(OT) Ken Schaefer
- Re: [ActiveDir] VBScript help(OT) Tom Kern
- RE: [ActiveDir] VBScript help(OT) Rich Milburn
- Re: [ActiveDir] VBScript help(OT) Tom Kern
- Re: [ActiveDir] VBScript help(OT) Kamlesh Parmar
- RE: [ActiveDir] VBScript help(OT) Rich Milburn
