i had an assignment in which you had to create a program that generates 50 subfolders, though the program i made could do that, it couldnt generate over 100 folders. Im just curious. is the file extension too long? and how do i solve this? Script is below...
Dim strfolder, b, sub1
Dim strRoot2, root
strFolder = InputBox("Please Enter a Folder Name.")
b = InputBox("Please Enter How Many SubFolders")
If objFSO.FolderExists(strRoot & strFolder) Then
WScript.Echo "Folder " & strRoot & strFolder &_
" already exists"
Do while b>0
b = b-1
There doesn't seem to be anything wrong with your program that I could see off hand however the real line that it is crashing on is this:
It seems to fail depending on the length of the directory you give it. When I gave it the directory name "saodjaodjaojdoajdoiajdaodijaodja" it only did 8. It seems after some debugging that once strRoot gets to 255 characters it goes awry.
Would this problem happen to have anything to do with the Maximum Length allowed for paths in Windows?
Maximum Path Length
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\<some 256 character path string><NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)