Error trying to create a folder

Results 1 to 4 of 4

Thread: Error trying to create a folder

  1. #1
    Hud Guest

    Default Error trying to create a folder

    I get a bad file name error when using this code to create a folder on the server. The directory path is what shows up on my FTP program. Should I reverse the direction of the slashes? And why does it see it as a file? The variable APNAME has the right value when I look at the string. <BR><BR>FSOstr = "&#039;/c:/websites/sitename/" & APNAME & "&#039;"<BR>Dim fso, f<BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>Set f = fso.CreateFolder(FSOstr)

  2. #2
    Join Date
    Dec 1969

    Default slashes is my guess too...

    Yeah.. perhaps the slashes are wrong.. and that slash before c is odd to my eyes... =)<BR><BR>I do this usually:<BR>... <BR>Set myFolder = ObjFile.CreateFolder("c:lablamypagemyfolder")<BR> <BR>Honestly, you should have testing with the other slash before posting.. it takes 2 seconds... and you could have saved time... <BR><BR>Cheers, <BR><BR>Vadim C.

  3. #3
    Join Date
    Dec 1969

    Default RE: Error trying to create a folder

    first up why need to set "F",second why the slash in the beginning:<BR>Dim fso, f<BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>FSOs tr = "c:/websites/sitename/" & APNAME<BR>if not fso.folderexists (FSOstr) then<BR>fso.CreateFolder(FSOstr)<BR>else<BR>respon se.write "Folder already exists."<BR>end if<BR>set fso = nothing

  4. #4
    Hud Guest

    Default Thanks

    I will try this one. This is the first time I used the FileSystemObject. And I mainly copied my code off the Microsoft example on the help site

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts