URGENT

  • Thread starter meenu_susi meenu_susi
  • Start date
M

meenu_susi meenu_susi

hi all

Could you please help me out i creating folder using vbscript..

I have used the following code...


<SCRIPT LANGUAGE="VBScript">
<!--
Option Explicit
Dim objFSO, objFolder, strDirectory
strDirectory = "c\testing"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder(strDirectory)
alert("strDirectory")
WScript.Echo "Just created " & strDirectory
WScript.Quit

</script>

and i am getting the following error..

Expected statement
800A0400
Microsoft VBScript compilation error

thanks in advance

reagrds
meenu
 
A

Alberto Poblacion

You would get better answers if you asked the question in a VB forum instead
of the C# one.

Anyway, the problem is probably in the "alert" statement, which is a
javascript instruction but not recognized in VBScript.
Also, notice that you are missing a colon in "c\testing".
And besides, the "<script...>" tag and the "<!--" comment (which by the way
is not closed) lead me to believe that you are trying to use the vbscript
block inside a web page, which has lots of limitations. It will only work in
Internet Explorer, and it is subject to the security limitations of the
browser environment which, among other things, should forbid you from
accessing the filesystem.


in message
news:[email protected]...
 
J

Joe Fawcett

I would agree with most things you say except that 'alert' is NOT a
JavaScript function, it's a method of the window object and, as such, can be
used equally well in either script language.
 
J

Jeff Johnson

You would get better answers if you asked the question in a VB forum
instead of the C# one.

No, most VB forums will simply redirect the poster to a SCRIPT forum.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top