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)
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>
|
|
|
|
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)
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
|
|
|
|
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)
hi thanks for that but i need to verify a folder exists not the C: drive could you help?
|
|
|
|
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)
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?
|
|
|
|
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)
hey sorry for the mess around i would like it for anywhere on the drive are you able to help?
|
|
|
|
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)
The FAQ have examples for traversing directory trees.
|
|
|
|
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)
thanks ill have a look in there now hopefully it helps me if not can i pm you?
|
|
|
|
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)
No, you cannot PM me. You can post here again, though.
|
|
|
|
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)
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
|
|
|
|
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)
i just cant get it working is there anyone that could please help me? thanks
|
|
|
|
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)
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
|
|
|
|
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)
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
|
|
|
|
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)
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
|
|
|
|
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)
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.
|
|
|
|