lost in ASP & WSH!please help!

Ask a Question related to ASP, Design and Development.

  1. #1

    Default lost in ASP & WSH!please help!

    I am using the VBScript and WSH to get the existing
    printer network. The code:

    <script language="VBScript" type="text/VBScript">
    Dim existing
    Set WshNetwork = CreateObject("WScript.Network")

    Set objPrinters = WshNetwork.EnumPrinterConnections

    For i = 0 to objPrinters.Count - 1 Step 2
    MsgBox objPrinters.Item(i+1)
    Next
    </script>

    The code works, however, I wanna show it on my asp
    webpage, how can i get the VBS variable and then use
    response.write to show "objPrinter.Item" ???

    Please help!!Thanks a lot!!!

    kyiu Guest

  2. Similar Questions and Discussions

    1. help I'm lost
      Hi everyone I am working on a website and to get me going I used a template, which I am editing using Dreamweaver 8 and associated programs...
    2. Lost CD
      Hi everyone, I purchased the book Macromedia Dreamweaver MX 2004 with asp, coldfusion, and php. Unfortunately, whilst working in the library, I...
    3. Lost as can be
      I am completely lost. I used a WebMatrix wizard and tried to make it a DataList. I get no errors but it doesn't work either. I really need help....
    4. lost of 8MB of RAM on my
      Hi, I recently bought a new laptop from toshiba, and it should have 512MB of RAM but in the sytem properties it tells me that I have 496 MB of...
    5. I've lost it!
      Not long ago in the Adobe Exchange, someone posted either a style or an action that produced a "swiss cheese" effect. If I'm not mistaken, it was...
  3. #2

    Default Re: lost in ASP & WSH!please help!

    your code - slightly modified - works
    <%
    Dim WshNetwork, objPrinters, i
    Set WshNetwork = server.CreateObject("WScript.Network")
    Set objPrinters = WshNetwork.EnumPrinterConnections
    For i = 0 to objPrinters.Count - 1 Step 2
    response.write objPrinters.Item(i+1) & "<br/>"
    Next
    %>

    If you dont see any printers the reason could be as follows:
    Your web page might be running as anonymous (generally the user context
    would be IUSR_<machine name>). If the printer connections are attached to
    the logged in user profile then IUSR_... won't have any. Change the
    security on the ASP page - remove anonymous and turn ON Integrated. It
    should work now.



    "kyiu" <karenyiu@hkusua.hku.hk> wrote in message
    news:064e01c3478d$e89a8f30$a601280a@phx.gbl...
    > I am using the VBScript and WSH to get the existing
    > printer network. The code:
    >
    > <script language="VBScript" type="text/VBScript">
    > Dim existing
    > Set WshNetwork = CreateObject("WScript.Network")
    >
    > Set objPrinters = WshNetwork.EnumPrinterConnections
    >
    > For i = 0 to objPrinters.Count - 1 Step 2
    > MsgBox objPrinters.Item(i+1)
    > Next
    > </script>
    >
    > The code works, however, I wanna show it on my asp
    > webpage, how can i get the VBS variable and then use
    > response.write to show "objPrinter.Item" ???
    >
    > Please help!!Thanks a lot!!!
    >

    Dhananjay Modak Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139