URGENT

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • meenu_susi meenu_susi

    URGENT

    hi all

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

    I have used the following code...


    <SCRIPT LANGUAGE="VBScr ipt">
    <!--
    Option Explicit
    Dim objFSO, objFolder, strDirectory
    strDirectory = "c\testing"
    Set objFSO = CreateObject("S cripting.FileSy stemObject")
    Set objFolder = objFSO.CreateFo lder(strDirecto ry)
    alert("strDirec tory")
    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
  • Alberto Poblacion

    #2
    Re: URGENT

    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.


    "meenu_susi meenu_susi" wrote in message
    news:2008102915 826meenu_susi@y ahoo.co.in...
    Could you please help me out i creating folder using vbscript..
    >
    I have used the following code...
    >
    >
    <SCRIPT LANGUAGE="VBScr ipt">
    <!--
    Option Explicit
    Dim objFSO, objFolder, strDirectory
    strDirectory = "c\testing"
    Set objFSO = CreateObject("S cripting.FileSy stemObject")
    Set objFolder = objFSO.CreateFo lder(strDirecto ry)
    alert("strDirec tory")
    WScript.Echo "Just created " & strDirectory
    WScript.Quit
    >
    </script>
    >
    and i am getting the following error..
    >
    Expected statement
    800A0400
    Microsoft VBScript compilation error

    Comment

    • Joe Fawcett

      #3
      Re: URGENT

      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.

      --

      Joe Fawcett (MVP - XML)



      "Alberto Poblacion" <earthling-quitaestoparaco ntestar@poblaci on.orgwrote
      in message news:%23ApPHdZO JHA.4180@TK2MSF TNGP05.phx.gbl. ..
      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.
      >
      >
      "meenu_susi meenu_susi" wrote in message
      news:2008102915 826meenu_susi@y ahoo.co.in...
      >Could you please help me out i creating folder using vbscript..
      >>
      >I have used the following code...
      >>
      >>
      ><SCRIPT LANGUAGE="VBScr ipt">
      ><!--
      >Option Explicit
      >Dim objFSO, objFolder, strDirectory
      >strDirectory = "c\testing"
      >Set objFSO = CreateObject("S cripting.FileSy stemObject")
      >Set objFolder = objFSO.CreateFo lder(strDirecto ry)
      >alert("strDire ctory")
      >WScript.Echo "Just created " & strDirectory
      >WScript.Quit
      >>
      ></script>
      >>
      >and i am getting the following error..
      >>
      >Expected statement
      >800A0400
      >Microsoft VBScript compilation error
      >

      Comment

      • Mark Rae [MVP]

        #4
        Re: URGENT

        "meenu_susi meenu_susi" wrote in message
        news:2008102915 826meenu_susi@y ahoo.co.in...
        Could you please help me out i creating folder using VBScript..
        You're in the wrong newsgroup - this one is for C#...

        microsoft.publi c.scripting.vbs cript
        microsoft.publi c.scripting.wsh


        --
        Mark Rae
        ASP.NET MVP


        Comment

        • Jeff Johnson

          #5
          Re: URGENT

          "Alberto Poblacion" <earthling-quitaestoparaco ntestar@poblaci on.orgwrote
          in message news:%23ApPHdZO JHA.4180@TK2MSF TNGP05.phx.gbl. ..
          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.


          Comment

          Working...