VBSCRIPT not running from map drive

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Scripting
    New Member
    • Apr 2008
    • 4

    #1

    VBSCRIPT not running from map drive

    Hi

    I am not sure this is right place for this question

    I am new to vbscripting... Just write this very simple vbscript file Its working perfectly if run from my local PC. If I run this same file from shared drive the script is not executing. Please some one can help to fix this issue.

    It would be hightly appriciated if someone can help me asap..please

    Thanks in Advance

    Code
    =====
    <html>
    <head>
    <script language="vbscr ipt" type="text/vbscript">
    dim str
    dim opt
    dim srcPath, mypath

    <!-- Procedure to load Group List -->
    Sub Window_Onload
    ForReading = 1
    i=0
    set FSO = createObject("s cripting.filesy stemobject")
    set Fldr =FSO. GetFolder("./")
    srcPath = Fldr.Path & "\Tel"
    mypath = srcpath


    strNewFile = srcPath & "\Location. txt"
    msgbox strNewFile
    Set objFSO = CreateObject("S cripting.FileSy stemObject")
    Set objFile = objFSO.OpenText File(strNewFile , ForReading)
    Do Until objFile.AtEndOf Stream
    strLine = objFile.ReadLin e
    Set objOption = Document.create Element("OPTION ")
    objOption.Text = strLine
    objOption.Value = strLine
    frm1.Location.A dd(objOption)
    i=i+1
    Loop
    objFile.Close
    End Sub

    </script>
    </head>
    <body>
    <form name="frm1">
    <Center>
    <body>
    <SELECT NAME="Location" >
    </form>

    </body>
    </html>
  • Scripting
    New Member
    • Apr 2008
    • 4

    #2
    Hi

    Any suggestions on this please.

    Comment

    • !NoItAll
      Contributor
      • May 2006
      • 297

      #3
      Other than making sure you have permission to execute vbscript from that drive is it possible that you are trying to run the script from a Windows service?
      Mapped drives are not available to services - so you have to use the UNC instead (e.g. Instead of g: use \\servername\sh arename\vbscrip t.vbs)

      Comment

      Working...