+ Post New Thread
Results 1 to 4 of 4
Windows Thread, WTF -MS VS 2005 kills rpinter script? in Technical; Ok I realise the title makes no logical sense what so ever but I'm sitting here looking at the problem ...
  1. #1

    Join Date
    Jun 2006
    Location
    Belfast, N\'Ireland
    Posts
    190
    Thank Post
    10
    Thanked 9 Times in 7 Posts
    Rep Power
    18

    WTF -MS VS 2005 kills rpinter script?

    Ok I realise the title makes no logical sense what so ever but I'm sitting here looking at the problem and thats the only way to describe it. A little Background.

    This year we had to add some more licenses to allow larger classes to use visual basic in computing classes. Obviosuly VB6 is defunct as far as MS is concerned but they agreed to upgrade our VB6 licenses to VS2005 and add more VS2005 licenses. Upgrades are a pain cos learning resources will be made obsolete but it can't be helped. We got our VS2005 license I installed all the prereqs from GPO, .net2, MSXML (the whole kitchen sink) used the admin installer to make a mst file for our needs and deployed it by GPO. That shoulda been it just some adjustment needed from Pupils and staff to the new menus etc.

    Today I got a report that somone couldn't print. I looked on they're account no printers. I logged in myself no printers.

    I use a user login script that I got from here to assign printers.

    Code:
    Set oNet=wscript.createobject("wscript.network")
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set AllPrinters = oNet.EnumPrinterConnections
    
    On Error Resume Next
    For i = 0 to AllPrinters.Count -1 Step 2
    oNet.RemovePrinterConnection AllPrinters.Item(i+1), true 
    Next
    
    strComputerDN = objSysInfo.ComputerName
    comp=Parse(strComputerDN)
    'Wscript.Echo Comp
    Function Parse(strDN)
    Parse = Mid(strDN, InStr(strDN, "=") + 1)
    Parse = Mid(Parse, InStr(Parse, "=") + 1)
    Parse = MId(Parse, 1, InStr(Parse, "=") - 4)
    End Function
    
    Select Case Comp
    Case "R214"
    strPrinter="\\Server2\R214-Laser1"
    strprinter2="\\Server2\R214-ColourLaser"
    
    ...........
    
    End select
    
    If strPrinter <> "" Then
    oNet.AddWindowsPrinterconnection strPrinter
    oNet.SetDefaultPrinter strPrinter
    End If
    If strPrinter2 <> "" Then
    oNet.AddWindowsPrinterconnection strPrinter2
    End If
    If strPrinter3 <> "" Then
    onet.AddWindowsPrinterconnection strPrinter3
    End If
    It worked on these machines before VS2005 and still works in the rest of the school so its got to be related.

    Even if I run the script from my desktop with an admin account it just appears to not execute. Anyone any ideas? There is nothin helpful in event log etc.

  2. #2
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: WTF -MS VS 2005 kills rpinter script?

    Random thought but has the default action for *.vbs been changed to open file in vs2005 instead of executing it?

  3. #3

    bossman's Avatar
    Join Date
    Nov 2005
    Location
    England
    Posts
    3,905
    Thank Post
    1,186
    Thanked 1,057 Times in 749 Posts
    Rep Power
    328

    Re: WTF -MS VS 2005 kills rpinter script?

    Are other VB scripts able to run?
    Just a thought as another NM of mine had to adjust one of the GPOs to allow due to an upgrade on one of the service packs for the servers (2k3r2).

  4. #4

    Join Date
    Jun 2006
    Location
    Belfast, N\'Ireland
    Posts
    190
    Thank Post
    10
    Thanked 9 Times in 7 Posts
    Rep Power
    18

    Re: WTF -MS VS 2005 kills rpinter script?

    Ok I think I've got it. At least ona test machine.

    *.vbs still had a VBscript icon but it seemed it had lost its association with wscript host. It wasn't opening in VS2005 and it wasn't popping up a "what program should I use" prompt. It was just doin nothing.

    Gonna try the rest of the room and cross my fingers.

SHARE:
+ Post New Thread

Similar Threads

  1. SIMs backup script after SQL 2005 migration failing...
    By mullet_man in forum MIS Systems
    Replies: 13
    Last Post: 23rd November 2007, 06:03 PM
  2. SQL 2005
    By jcollings in forum MIS Systems
    Replies: 12
    Last Post: 22nd October 2007, 03:00 PM
  3. Question about sql 2005
    By dezt in forum MIS Systems
    Replies: 11
    Last Post: 26th September 2007, 10:40 PM
  4. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  5. Virtual Server 2005 R2 kills server network connection
    By ajbritton in forum Thin Client and Virtual Machines
    Replies: 0
    Last Post: 31st August 2006, 06:19 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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