VJ
-
Total Posts
:
6
- Scores: 0
-
Reward points
:
0
- Joined: 11/17/2011
-
Status: offline
|
need help on VB Script.
Thursday, November 17, 2011 8:40 AM
( permalink)
I am try to customize the VB Script given here - http://www.code-bytes.com/Automate_WSH_VBScript_To_Delete_Or_Archive_Files.html but what ever file name or extension i am passing it's taking all the files in consideration. I found that in bellow code - if FileExtNameRegExpressionObject.Test(getFileExtention(oFile.Name)) then if FileNameRegExpressionObject.Test(getFileName(oFile.Name)) then getFileExtention(oFile.Name) & getFileName(oFile.Name) returning no value. Any one could help me...!!
|
|
|
|
59cobalt
-
Total Posts
:
981
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: offline
|
Re:need help on VB Script.
Thursday, November 17, 2011 9:15 AM
( permalink)
GetFileExtension() and GetFileName() are FileSystemObject methods.
|
|
|
|
VJ
-
Total Posts
:
6
- Scores: 0
-
Reward points
:
0
- Joined: 11/17/2011
-
Status: offline
|
Re:need help on VB Script.
Thursday, November 17, 2011 9:44 AM
( permalink)
i tried this as well - if FileExtNameRegExpressionObject.Test(oFSO.GetFileExtention(oFile.Name)) then if FileNameRegExpressionObject.Test(oFSO.GetFileName(oFile.Name))then but didn't work.... Bellow Changes worked fine - ( e.g. oFile.Name = test.log) if FileExtNameRegExpressionObject.Test(oFSO.GetExtensionName(oFile.Name)) = logif FileNameRegExpressionObject.Test(oFSO.GetBaseName(oFile.Name)) then = test
<message edited by VJ on Thursday, November 17, 2011 10:02 AM>
|
|
|
|
59cobalt
-
Total Posts
:
981
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: offline
|
Re:need help on VB Script.
Friday, November 18, 2011 10:49 AM
( permalink)
So, how exactly did it "not work"? Post your customized script, the arguments you're passing when you call it, and what errors you get (if any). Also describe what the actual results are, and what the desired/expected results would be.
|
|
|
|