Announcement

Collapse
No announcement yet.

Quick Login Script Question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quick Login Script Question

    Hi all

    I have a login script that points users to another script to add printers.

    In that other script (printers.bat) it just has 1 line for each printer:

    START //server/printer

    However those printers have now been moved to another server.

    The amended printers.bat script works fine, except it has left the old ones on the user's PC still.

    How do I make the script also delete the old references?

  • #2
    Re: Quick Login Script Question

    Hi,

    What is the reason for having a logon script that calls another script?
    and can you post the contents of the other script responsible for mapping the printer?
    Caesar's cipher - 3

    ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

    SFX JNRS FC U6 MNGR

    Comment


    • #3
      Re: Quick Login Script Question

      Erm, I'm pretty sure I asked here about 6 months ago and was advised to di it like that

      Logon Script:

      Code:
      @echo off
      
      echo Mapping F and G Drives...
      net use f: \\vic003\f
      net use g: \\vic003\g
      
      echo Synchronising Time...
      net time \\vic003 /set /yes
      
      regedit /s \\vic003\netlogon\vww.reg
      
      mkdir "%appdata%\microsoft\templates\"
      mkdir "%appdata%\microsoft\stationery\"
      
      echo Copying Microsoft Templates...
      copy \\vic003\software\wordtemplates\normal.dot "%appdata%\microsoft\templates\" /y
      copy \\vic003\software\wordtemplates\normal.dotm "%appdata%\microsoft\templates\" /y
      copy \\vic003\software\wordtemplates\normalemail.dotm "%appdata%\microsoft\templates\" /y
      copy \\vic003\software\wordtemplates\VWW.htm "%appdata%\microsoft\stationery\" /y
      
      echo Mapping A3 Printer...
      \\vic003\netlogon\printers.bat
      
      echo on
      Printers.bat

      Code:
      START \\vic003\K850
      Had more, in the process of moving some around.

      In any case, the \\vic003\K850 in printers.bat USED to be \\print\A3

      Now some users have both and are getting confused about which one to use.

      Comment


      • #4
        Re: Quick Login Script Question

        Originally posted by hongman View Post
        Erm, I'm pretty sure I asked here about 6 months ago and was advised to di it like that
        Aha, ok. So you are using the Start command to download the printer drivers?
        Caesar's cipher - 3

        ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

        SFX JNRS FC U6 MNGR

        Comment


        • #5
          Re: Quick Login Script Question

          Im not sure what the Start command has to do with printer drivers but...

          All I know is, now I have changed the script to map the new printer, users have references to the old printer still and its confusing them.

          I'm looking for a similar command to net use /delete, but for printers.

          Thank you

          Comment


          • #6
            Re: Quick Login Script Question

            Originally posted by hongman View Post
            Erm, I'm pretty sure I asked here about 6 months ago and was advised to di it like that
            I don't know, maybe that there was a good reason for it back then, do you have a link to that thread? Looking at the scripts you posted in this thread I don't see why you should calling for a seperate batch(es).

            Any way, if you are calling an other batch from within a batch you should do it like this:
            Call "\\vic003\netlogon\printers.bat"
            otherwise, if you don't use call the dosbox will close when the other batch has ended and not returning anymore to the original batch.

            To disconnect a mapped printer you can try:
            rundll32 printui.dll,PrintUIEntry /dn /q /n "\\OLDSERVER\K850"
            (there is chance this could fail when the \\oldserver\sharedprinter does not exist anymore on the network, When fails you probably have to remove the pinter(s) from registry with a script)

            To connect a networkprinter, try:
            rundll32 printui.dll,PrintUIEntry /in /q /n "\\NEWSERVER\K850"


            \Rems

            This posting is provided "AS IS" with no warranties, and confers no rights.

            __________________

            ** Remember to give credit where credit's due **
            and leave Reputation Points for meaningful posts

            Comment

            Working...
            X