|
Call
Randomize() to initialize the random number generation algorithm somewhere in
your script, prior to the first call to Rnd() Could
I suggest you get the Windows Script Host 5.6 documentation: Some
of the things you are running into are dealt with more quickly by just looking
up the relevant topics… Cheers Ken From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Kern Thanks alot!! Unfortuantely it only seems to work when i ran it the first
time. if i kill it and run it again and it encounters a duplicate
file in the source dir it throws an error-"file already
exisits". will it only work in one shot? thanks On 12/8/05, Rich Milburn <[EMAIL PROTECTED]>
wrote: Replace your
last sub: sub
filelist(grp) for each
file in grp.files if
targ.files.count>=999 then full=true:exit for if
lcase(fso.getextensionname(file)) = "eml" then set
objFile = fso.getfile(file)
arrFileName = Split(objfile.Name,".")
oldname = arrFileName(0)
ext = arrFileName(1)
if fso.FileExists(target & objFile.Name) then
newfile=oldname & cstr(int(Rnd * 1000)) & "." & ext
Else
newfile=objFile.Name
end if
wscript.echo newfile
fso.MoveFile file,target & newfile end if next End sub ----------------------------------------------------------------------- |
