Announcement

Collapse
No announcement yet.

Batch Script execution on Terminal Server 2003

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

  • Batch Script execution on Terminal Server 2003

    I have set up a terminal server, Windows Server 2003 SP1 with R2.
    Users that use this server do different jobs using same Server. Each user has its startup script, which should map different shared drives from File Server and different printers from Local Computer.
    When a user session starts, the script starts to run, but it doesn't map a printer in local computer, it requires username and password for the machine where the printer is installed and shared. When I type Username and Password (Local Admin) the script appears like finished execution and closes, but still doesn't map the printer.
    I have tested a user ... I made it Local Admin in Terminal Server, the script appears to execute and it doesn't map the printer
    It is very strange to me that batch scripts which are to map only share drives work perfect

  • #2
    Re: Batch Script execution on Terminal Server 2003

    This would probably be more appropriate in the Terminal Services forum.

    Can you please post the script so we can see what you have put in it?

    Tom
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: Batch Script execution on Terminal Server 2003

      net use lpt1: /delete
      net use lpt1: "\\servername\printername"

      servername = name of computer where the printer is installed locally
      printername = sharename of the printer

      thanks

      Comment


      • #4
        Re: Batch Script execution on Terminal Server 2003

        IIRC there should not be quotes in line 2 unless there are spaces in the printer share name

        Try without them

        Tom
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Batch Script execution on Terminal Server 2003

          Same thing again. It can not find LPT1 to delete I think
          Attached Files

          Comment


          • #6
            Re: Batch Script execution on Terminal Server 2003

            Ah, the vital missing information on the actual error you get!

            Is LPT1 already mapped?

            Why not use VBScript? That way you can have a conditional
            IF lpt1 exists THEN
            delete lpt1
            END IF

            Try here for a starting point

            Tom
            Tom Jones
            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
            PhD, MSc, FIAP, MIITT
            IT Trainer / Consultant
            Ossian Ltd
            Scotland

            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment


            • #7
              Re: Batch Script execution on Terminal Server 2003

              Still doesn't work. It seems that problem is not in the script type, but in W2K3 Security ...?
              See PrintScr Error
              Attached Files

              Comment


              • #8
                Re: Batch Script execution on Terminal Server 2003

                Can you post the whole VB script -- that is a syntax error message

                Tom
                Tom Jones
                MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
                PhD, MSc, FIAP, MIITT
                IT Trainer / Consultant
                Ossian Ltd
                Scotland

                ** Remember to give credit where credit is due and leave reputation points where appropriate **

                Comment


                • #9
                  Re: Batch Script execution on Terminal Server 2003

                  Hi
                  If there are no printers mapped, it won't be able to delete anything.
                  I know its a bit too obvious but make sure the server were the printer is shared is up.
                  Alternatively try this site: http://www.robvanderwoude.com/
                  there is a wide range of batch examples including Addprint.bat and Addipprn.bat

                  Good luck (Tung)
                  Caesar's cipher - 3

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

                  SFX JNRS FC U6 MNGR

                  Comment


                  • #10
                    Re: Batch Script execution on Terminal Server 2003

                    Check this out as well:
                    http://forums.petri.com/showthread.p...ht=add+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


                    • #11
                      Re: Batch Script execution on Terminal Server 2003

                      Printers.vbs - Windows Logon Script.
                      Set objNetwork = CreateObject("WScript.Network")
                      objNetwork.AddWindowsPrinterConnection "\\prinserver\printername"

                      Comment


                      • #12
                        Re: Batch Script execution on Terminal Server 2003

                        Tell me the first line is a comment and preceeded with '

                        'Printers.vbs etc...


                        Tom
                        Tom Jones
                        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
                        PhD, MSc, FIAP, MIITT
                        IT Trainer / Consultant
                        Ossian Ltd
                        Scotland

                        ** Remember to give credit where credit is due and leave reputation points where appropriate **

                        Comment


                        • #13
                          Re: Batch Script execution on Terminal Server 2003

                          vxhelili ,

                          please post you're complete script otherwise we can't help you out.
                          Also please provide the complete error message.

                          You really really need to think what you're posting. We cannot guess everything, we cannot see everything.

                          Start reading http://forums.petri.com/announcement.php?f=11


                          also see this topic:
                          http://forums.petri.com/showthread.php?t=404

                          It looks more like a scripting issue then a TS issue.
                          maybe it's an idea to move to the scripting Forum.
                          Marcel
                          Technical Consultant
                          Netherlands
                          http://www.phetios.com
                          http://blog.nessus.nl

                          MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
                          "No matter how secure, there is always the human factor."

                          "Enjoy life today, tomorrow may never come."
                          "If you're going through hell, keep going. ~Winston Churchill"

                          Comment


                          • #14
                            Re: Batch Script execution on Terminal Server 2003

                            Dumber,

                            I wouldn't say that this is scripting error. I use same batch script on Win 2000 Server, Terminal Server, and it works perfect. The reason why I need to map printer with script is because of an application which is DOS Based, and when processing, it doesnt print voucher.
                            The way how do I use this script on Win2000 Server, Terminal Server is simple as I have posted it earlier. There are no more lines in the script
                            thanks

                            Comment

                            Working...
                            X