Announcement

Collapse
No announcement yet.

Run batch on connection TS 2008

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

  • Run batch on connection TS 2008

    Hello,
    Any idea how to run a batch file (with vbs script inside) when user reconnecting to existing session? Won't work with task scheduler

  • #2
    Re: Run batch on connection TS 2008

    What is the job of this batch file?
    Best Regards,

    Yuval Sinay

    LinkedIn: https://www.linkedin.com/in/yuval14, Blog: http://blogs.microsoft.co.il/blogs/yuval14

    Comment


    • #3
      Re: Run batch on connection TS 2008

      echo off
      set cn=%clientname:~0,3%

      if %cn%==AAA goto :AAAA
      if %cn%==BBB goto :BBBB
      if %cn%==CCC goto :CCCC

      goto :end

      :AAAA
      C:\Windows\SysWOW64\cscript c:\windows\system32\prnmngr.vbs -t -p "ricoh A"
      goto :end

      :BBBB
      C:\Windows\SysWOW64\cscript c:\windows\system32\prnmngr.vbs -t -p "ricoh B"
      goto :end

      :CCCC
      C:\Windows\SysWOW64\cscript c:\windows\system32\prnmngr.vbs -t -p "ricoh C"
      goto :end

      :end

      Comment


      • #4
        Re: Run batch on connection TS 2008

        Why you don't use Group Policy preference instead?
        Best Regards,

        Yuval Sinay

        LinkedIn: https://www.linkedin.com/in/yuval14, Blog: http://blogs.microsoft.co.il/blogs/yuval14

        Comment


        • #5
          Re: Run batch on connection TS 2008

          group policy is applied when user log in, not when reconnecting to existing session.

          Comment


          • #6
            Re: Run batch on connection TS 2008

            You can change the GPO applied interval...
            Last edited by yuval14; 20th July 2012, 13:48.
            Best Regards,

            Yuval Sinay

            LinkedIn: https://www.linkedin.com/in/yuval14, Blog: http://blogs.microsoft.co.il/blogs/yuval14

            Comment


            • #7
              Re: Run batch on connection TS 2008

              every 2 minutes?

              Comment


              • #8
                Re: Run batch on connection TS 2008

                You can try, but what is the need for remapping printers?!
                Best Regards,

                Yuval Sinay

                LinkedIn: https://www.linkedin.com/in/yuval14, Blog: http://blogs.microsoft.co.il/blogs/yuval14

                Comment


                • #9
                  Re: Run batch on connection TS 2008

                  One person need to swap client pc few times per day. This script is changing default printer.

                  Comment


                  • #10
                    Re: Run batch on connection TS 2008

                    Then, say to him to log off/on or put a shortcut for script on its desktop... Thats all...
                    Best Regards,

                    Yuval Sinay

                    LinkedIn: https://www.linkedin.com/in/yuval14, Blog: http://blogs.microsoft.co.il/blogs/yuval14

                    Comment


                    • #11
                      Re: Run batch on connection TS 2008

                      log off? what for? shut down all applications? where was a point to run TS? no way.

                      Comment


                      • #12
                        Re: Run batch on connection TS 2008

                        IMHO give them a script they can run on demand -- simplest option and most users are just about capable of doing it.
                        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

                        Working...
                        X