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:
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7B
instead of creating random, what I had done was
create a for loop, say 1..1 (fairly high number to get the unique name)
and append that number if file exists in target,
if not exists go ahead and append that number to filename for destination and exit the loop
otherwise continue to next num
fileexists is a method for FSO object
and you are attaching it to a folder object.
Try fso.fileexistsOn 12/8/05, Tom Kern <[EMAIL PROTECTED]> wrote:
Thanks alot!!
I still can't get the rename to work.
the script copies a bunch of eml files from a bunch of source sub
folders. in those s
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
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(
Thanks alot!!
I still can't get the rename to work.
the script copies a bunch of eml files from a bunch of source sub folders. in those sub folders the files have duplicate names but because they are in sub folders, it doesn't matter until they are being copied to the single target folder
Tom,
if lcase(fso.getextensionname(file)) = "eml" then file.move
target
---
Rich Milburn
MCSE, Microsoft MVP -
Directory Services
Sr Network Analyst, Field Platform Development
Applebee's International, Inc.
4551 W.
isn't there a way to do it without passing the full path?
i thought in my statement its implied that whatever "file" should be, it should look for an .eml ext.
thanks
On 12/8/05, Ken Schaefer <[EMAIL PROTECTED]> wrote:
getExtensionName() requires you to pass it a filespec (a filename, or path to
getExtensionName()
requires you to pass it a filespec (a filename, or path to a file)
If
FSO.getExtensionName(“c:\windows\clock.avi”) = “avi” Then
‘
do foo
Else
‘
do bar
End
If
Cheers
Ken
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Beha
Oops, I guess i didn't check my code.
before i made any changes, i get "Wrong number of arguments or invalid propery assignment:'fso.getextensionname'.
sorry.
I wonder why that is?
On 12/7/05, Ken Schaefer <[EMAIL PROTECTED]> wrote:
At the moment you have this line which does the copy:if lcase
]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Kern
Sent: Thursday, 8 December 2005 12:00 PM
To: ActiveDir@mail.activedir.org
Subject: Re: [ActiveDir] VBScript help(OT)
Thanks.
My real problem is, I'm not sure where to put that in my exisiting script
without screwing things up
Should tha
if lcase(fso.getextensionname) = "eml" then
‘ Pseudo code from me
End if
Thanks,
Brian Desmond
[EMAIL PROTECTED]
c -
312.731.3132
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian
Desmond
Sent: Wednesday, December 07, 2005
7:41 PM
To: Ac
Thanks.
My real problem is, I'm not sure where to put that in my exisiting script without screwing things up
Should that be a seperate sub?
Thanks again
On 12/7/05, Brian Desmond <[EMAIL PROTECTED]> wrote:
I don't see the need for a select case, but File.Exists would help.
What I wou
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 * 1))
Wen
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(ma
Sent: Thursday, August 07, 2003 3:20 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] VBscript Help
I seem to be have to report more and more information on the AD. As I am
not from a scripting/programming background writing VBscripts is a little
bit trial and error.
Can anyone recommend any Web
August 07, 2003 3:20 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] VBscript Help
I seem to be have to report more and more information on the AD. As I
am not from a scripting/programming background writing VBscripts is a
little bit trial and error.
Can anyone recommend any Web resources, book
Many thanks for all the pointers. I better order some of the books :-) and read them,
QUICK!
Jacqui
> from:Gil Kirkpatrick <[EMAIL PROTECTED]>
> date:Thu, 07 Aug 2003 17:36:25
> to: [EMAIL PROTECTED]
> subject: RE: [ActiveDir] VBscript Help
>
> Alain
Add myITforum.com to that list...
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 10:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] VBscript Help
I keep a list of these sites - hope this helps
TECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 6:41 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [ActiveDir] VBscript Help
>
>
> Many thanks for all the pointers. I better order some of the
> books :-) and read them, QUICK!
>
> Jacqui
>
> >
Jacqui
There are some links to ADSI and scripting resources on the ActiveDir web site:
http://www.activedir.org/links.htm
Carlos probably has more.
One link I have yet to put up on the ActiveDir web site is to Robbie Allen's code from
his Cookbook. This is an excellent resource and pretty muc
LDAP query
formats, WMI scripting etc.
G.
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 07, 2003 8:19 PM
Subject: [ActiveDir] VBscript Help
> I seem to be have to report more and more information on the AD. As I am
not fro
o:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 1:29 PM
To: [EMAIL PROTECTED]
Subject: Re: [ActiveDir] VBscript Help
Jacqui
There are some links to ADSI and scripting resources on the ActiveDir
web site:
http://www.activedir.org/links.htm
Carlos probably has more.
One link I h
AIL PROTECTED]
Sent: Thursday, August 07, 2003 3:20 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] VBscript Help
I seem to be have to report more and more information on the AD. As I am
not from a scripting/programming background writing VBscripts is a little
bit trial and error.
Can anyone recommen
-Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 6:20 AM
> To: [EMAIL PROTECTED]
> Subject: [ActiveDir] VBscript Help
>
>
> I seem to be have to report more and more information on the
> AD. As I am not fr
I seem to be have to report more and more information on the AD. As I am not from a
scripting/programming background writing VBscripts is a little bit trial and error.
Can anyone recommend any Web resources, books etc that will help me.
The way I normally achieve my end result is by trawling
26 matches
Mail list logo