mbt masai
 
Welcome !
         

                                
After experiencing a lot of down time, We decided to move this site to CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.

 Calling VBS

Author Message
spiritnblk

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 9/2/2008
  • Status: offline
Calling VBS Tuesday, September 02, 2008 3:48 AM (permalink)
0
 
If I have this in the wrong forum, please feel to move it.


For whatever reason I can't get the Sub to run. Everything looks right (to me), but when I click on the image button, nothing happens. I'm basiclly learning as I go, so be gentle. :o)


<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >



<
head id="Head1" runat="server">

<
script language="vb" type="text/vb">
Sub
Public Copier3()

Dim
objShell

Dim
vbsFile
vbsFile = Server.MapPath(
"c:\PMP\copier3.vbs")

Set
objShell = Server.CreateObject("Wscript.Shell")
objShell.Run vbsFile



</
script>

<title>Untitled Page</title>




</
head>

<
body>



<form id="form1" runat="server">


<div style="position:absolute;top:325px;left:104px;width:300px;"><asp:ImageButton ID="Copier31" runat="server" ImageUrl="~/Images/1Copier3.gif" OnClientClick="Copier3" /></div>



&nbsp;

<div style="position:absolute;top:681px;left:194px;width:300px;"><asp:ImageButton ID="Copier32" runat="server" ImageUrl="~/Images/2Copier3.gif" OnClientClick="Copier3" /></div>

&nbsp;

<div style="position:absolute;top:786px;left:285px;width:300px;"><asp:ImageButton ID="Copier33" runat="server" ImageUrl="~/Images/3Copier3.gif" OnClientClick="Copier3" /></div>

<div style="position:absolute;top:777px;left:194px;width:300px;"><asp:ImageButton ID="Copier21" runat="server" ImageUrl="~/Images/1Copier2.gif" /></div>



<div style="position:absolute;top:876px;left:104px;width:300px;"><asp:ImageButton ID="Copier22" runat="server" ImageUrl="~/Images/2Copier2.gif" /></div>

<div style="position:absolute;top:892px;left:284px;width:300px;"><asp:ImageButton ID="NOC" runat="server" ImageUrl="~/Images/NOC.gif" /></div>


<div style="position:static;bottom:0px;left:7px;width:400px;"><asp:Image ID="FloorPlan" runat="server" ImageUrl="~/Images/Call Center Ports Plan_Model.gif" /></div>

</form>
</
body>
</
html>
 

 
 
VBS
 
[/size][/color]
 [color=#0000ff][size=2][/size][/color] 
 strPrinter="\\vamanprt01\MANPO-copier3"
 Set WshNetwork = CreateObject("WScript.Network")
 Set WshShell = CreateObject("WScript.Shell")
 WshNetwork.AddWindowsPrinterConnection strPrinter
 WshNetwork.SetDefaultPrinter strPrinter
 MsgBox strPrinter & " Printer connected and set as the default printer"
 Set WshNetwork = WScript.CreateObject("WScript.Network")
 
 


 
#1
    TNO

    • Total Posts : 2089
    • Scores: 34
    • Reward points : 0
    • Joined: 12/18/2004
    • Location: Earth
    • Status: offline
    RE: Calling VBS Thursday, September 25, 2008 4:06 PM (permalink)
    0
    In this situation I'm curious to why you don't just do it all in .NET?
    To iterate is human, to recurse divine. -- L. Peter Deutsch
    #2
      spiritnblk

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 9/2/2008
      • Status: offline
      RE: Calling VBS Thursday, November 06, 2008 7:03 AM (permalink)
      0
      I tried that, as well.
      #3
        TNO

        • Total Posts : 2089
        • Scores: 34
        • Reward points : 0
        • Joined: 12/18/2004
        • Location: Earth
        • Status: offline
        RE: Calling VBS Thursday, November 06, 2008 12:28 PM (permalink)
        0
        your page language is set to C#

        try doing it in C# inside your code behind instead
        To iterate is human, to recurse divine. -- L. Peter Deutsch
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.8
          mbt shoes www.wileywilson.com