Creating a New Folder in VBSCRIPT

I've got a command button in my web page and i want it to create a new folder on my web server...
I refer this to a vscript sub ..

Public Sub Command1_click()
Dim FSO, CreateNewFolder

Set FSO = Createobject("Scripting.FileSystemobject")

TempFolderName = text1.value

      If TempFoldername <> "" Then

Set FSO = Createobject("Scripting.FileSystemobject")
                  Set CreateNewFolder = FSO.CreateFolder("F:\Inetpub\wwwroot\oop" & "\" & TempFolderName)
            Msgbox("The Folder name was not found.")
      End If
End Sub

I get the error message a runtime error has occured.

Error Active x component can't create object 'scripting.filesystemobject'

can anybody help?
Who is Participating?
FRehmanConnect With a Mentor Commented:
you don't use command on click on client site FSO is only use on server site if you want server site scripting then write this code on you page

TempFolderName = text1.value
If TempFoldername <> "" Then
Set FSO = Createobject("Scripting.FileSystemobject")
FSO.CreateFolder("F:\Inetpub\wwwroot\oop\" + TempFolderName)
 response.write("there is now value")
end if
if you face any problem then contact me at
Probably the error message is not exact, I experienced the same case recently.
Make sure the iusr_machinename account (or the account logged in) has the right to write (and delete) in your oop folder.
I just posted something similar in your other version of this question.

Did you know that you had a duplicate question?

Robbert's time stamp is earlier than mine so if that's the problem, he should get credit.

You should also probably try to delete the other question before someone posts an answer to it.
That's client-side scripting-- Command1_Click.  

In order for that to work, you'd have to make sure FileSystemObject is installed on the client machine, drive F: is mapped to a share on your webserver and that the person logged in at the machine (not IUSR_machinename) had rights on the shared drive.

If you want to do that on the server-side, you'll have to change your Command1_click to a submit button that posts info to an ASP page that actually uses FSO.
All Courses

From novice to tech pro — start learning today.