need help on VB Script.

Author Message
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)
0
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...!!
 
#1
    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)
    0
    GetFileExtension() and GetFileName() are FileSystemObject methods.
     
    #2
      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)
      0
      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>
       
      #3
        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)
        0
        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.
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9