Help FSO Input

Author Message
david769

  • Total Posts : 6
  • Scores: 0
  • Reward points : 0
  • Joined: 10/19/2011
  • Status: offline
Help FSO Input Wednesday, October 19, 2011 3:03 PM (permalink)
0
Hi
I need some help creating this script
use the FileSystemObject to verify that a given folder exists and the user must enter the folder name in a inputbox.
 
FolderName = Inputbox("Enter Folder Name")
SearchLocation = "E:\"
If SearchName = FolderName Then
MsgBox("Folder Exists")
Else
Msgbox("No Folder Found")
End If
<message edited by david769 on Wednesday, October 19, 2011 3:30 PM>
 
#1
    Wakawaka

    • Total Posts : 456
    • Scores: 23
    • Reward points : 0
    • Joined: 8/27/2009
    • Status: offline
    Re:Help FSO Input Thursday, October 20, 2011 1:38 AM (permalink)
    0
    Using the shortest amount of code
     
    If CreateObject("Scripting.FileSystemObject").FolderExists(InputBox("Enter Folder Name", "Folder Path", "C:\")) Then 
     Msgbox "Folder Exists", vbOkOnly, "Folder Verification" 
    Else 
     Msgbox "Folder does not Exists", vbOkOnly, "Folder Verification" 
    End If 
      

    Using cleaner code
     
    Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") 
    Dim folderPath : folderPath = InputBox("Enter Folder Path", "Folder Path", "C:\") 
    If fso.FolderExists(folderPath) Then 
     Msgbox "Folder Exists", vbOkOnly, "Folder Verification" 
    Else 
     Msgbox "Folder does not Exists", vbOkOnly, "Folder Verification" 
    End If 
    

     
    #2
      david769

      • Total Posts : 6
      • Scores: 0
      • Reward points : 0
      • Joined: 10/19/2011
      • Status: offline
      Re:Help FSO Input Tuesday, November 01, 2011 6:41 PM (permalink)
      0
      hi
      thanks for that but i need to verify a folder exists not the C: drive
      could you help?
       
      #3
        59cobalt

        • Total Posts : 971
        • Scores: 91
        • Reward points : 0
        • Joined: 7/17/2011
        • Status: online
        Re:Help FSO Input Wednesday, November 02, 2011 11:52 AM (permalink)
        0
        Please be more precise about your requirements. Do you want to check for the existence of a folder directly under the root of a drive, or can the folder be anywhere on the drive?
         
        #4
          david769

          • Total Posts : 6
          • Scores: 0
          • Reward points : 0
          • Joined: 10/19/2011
          • Status: offline
          Re:Help FSO Input Wednesday, November 02, 2011 12:36 PM (permalink)
          0
          hey sorry for the mess around i would like it for anywhere on the drive are you able to help?
           
          #5
            59cobalt

            • Total Posts : 971
            • Scores: 91
            • Reward points : 0
            • Joined: 7/17/2011
            • Status: online
            Re:Help FSO Input Thursday, November 03, 2011 9:38 AM (permalink)
            0
            The FAQ have examples for traversing directory trees.
             
            #6
              david769

              • Total Posts : 6
              • Scores: 0
              • Reward points : 0
              • Joined: 10/19/2011
              • Status: offline
              Re:Help FSO Input Thursday, November 03, 2011 12:21 PM (permalink)
              0
              thanks ill have a look in there now hopefully it helps me if not can i pm you?
               
              #7
                59cobalt

                • Total Posts : 971
                • Scores: 91
                • Reward points : 0
                • Joined: 7/17/2011
                • Status: online
                Re:Help FSO Input Saturday, November 05, 2011 8:24 AM (permalink)
                0
                No, you cannot PM me. You can post here again, though.
                 
                #8
                  TNO

                  • Total Posts : 2094
                  • Scores: 36
                  • Reward points : 0
                  • Joined: 12/18/2004
                  • Location: Earth
                  • Status: offline
                  Re:Help FSO Input Saturday, November 05, 2011 10:21 AM (permalink)
                  0
                  david769


                  Hi
                  I need some help creating this script
                  use the FileSystemObject to verify that a given folder exists and the user must enter the folder name in a inputbox.

                  FolderName = Inputbox("Enter Folder Name")
                  SearchLocation = "E:\"
                  If SearchName = FolderName Then
                  MsgBox("Folder Exists")
                  Else
                  Msgbox("No Folder Found")
                  End If

                   
                  You should use a folder browsing script: http://wsh2.uw.hu/ch12f.html
                  To iterate is human, to recurse divine. -- L. Peter Deutsch
                   
                  #9
                    david769

                    • Total Posts : 6
                    • Scores: 0
                    • Reward points : 0
                    • Joined: 10/19/2011
                    • Status: offline
                    Re:Help FSO Input Monday, November 21, 2011 11:47 AM (permalink)
                    0
                    i just cant get it working is there anyone that could please help me? thanks
                     
                    #10
                      TNO

                      • Total Posts : 2094
                      • Scores: 36
                      • Reward points : 0
                      • Joined: 12/18/2004
                      • Location: Earth
                      • Status: offline
                      Re:Help FSO Input Monday, November 21, 2011 12:18 PM (permalink)
                      0
                      david769


                      i just cant get it working is there anyone that could please help me? thanks

                       
                      What do you have thus far? Did you try any of the suggestions above?
                      To iterate is human, to recurse divine. -- L. Peter Deutsch
                       
                      #11
                        david769

                        • Total Posts : 6
                        • Scores: 0
                        • Reward points : 0
                        • Joined: 10/19/2011
                        • Status: offline
                        Re:Help FSO Input Monday, November 21, 2011 12:31 PM (permalink)
                        0
                        yes i did i got 4 different scripts but they do not work all they do is verify that the drive is there i want to be able to type in a name of a file and it verify it exists
                         
                        #12
                          TNO

                          • Total Posts : 2094
                          • Scores: 36
                          • Reward points : 0
                          • Joined: 12/18/2004
                          • Location: Earth
                          • Status: offline
                          Re:Help FSO Input Monday, November 21, 2011 2:13 PM (permalink)
                          0
                          david769


                          yes i did i got 4 different scripts but they do not work all they do is verify that the drive is there i want to be able to type in a name of a file and it verify it exists

                           
                          Originally you said "Folder", now you say "File". Did you try this with the word Folder replaced with the word File:
                           
                          http://www.visualbasicscript.com/fb.ashx?m=94379
                           
                          What exactly did you type that didn't work?
                          To iterate is human, to recurse divine. -- L. Peter Deutsch
                           
                          #13
                            59cobalt

                            • Total Posts : 971
                            • Scores: 91
                            • Reward points : 0
                            • Joined: 7/17/2011
                            • Status: online
                            Re:Help FSO Input Tuesday, November 22, 2011 10:57 AM (permalink)
                            0
                            david769
                            yes i did i got 4 different scripts but they do not work all they do is verify that the drive is there i want to be able to type in a name of a file and it verify it exists
                            We still need to see what you actually have.
                             
                            #14

                              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