Announcement

Collapse
No announcement yet.

batch file that prints timestamp

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

  • batch file that prints timestamp

    I'm trying to create a script that will send a test page to the default printer giving off a time stamp.

    so all the users have to do is click on this batch file on the desktop to make sure their printer is working and it gives the exact time of when they performed the test.

    I'm not good at scripting and any help would be great. thanks.

  • #2
    Re: batch file that prints timestamp

    Code:
    echo This file was printed on %date% %time% > date.txt
    NOTEPAD /P date.txt
    I've created this so far but I'd like to have it just print...not create the file and then print. Stupid I know...

    Comment


    • #3
      Re: batch file that prints timestamp

      This will help:
      http://blogs.technet.com/heyscriptin...-a-script.aspx
      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


      • #4
        Re: batch file that prints timestamp

        What about just deleting the file after you're done with it?...

        Code:
        echo This file was printed on %date% %time% > date.txt
        NOTEPAD /P date.txt
        ping 1.1.1.1 > nul
        del date.txt
        Regards,
        Jeremy

        Network Consultant/Engineer
        Baltimore - Washington area and beyond
        www.gma-cpa.com

        Comment


        • #5
          Re: batch file that prints timestamp

          Originally posted by JeremyW View Post
          What about just deleting the file after you're done with it?...

          Code:
          echo This file was printed on %date% %time% > date.txt
          NOTEPAD /P date.txt
          ping 1.1.1.1 > nul
          del date.txt

          In addition, you could also start notepad minimized
          Code:
          @echo off
          
          Set "$$$dt=%temp%.\$$$dt"
          
          > "%$$$dt%" (
            echo This file was printed on %date% %time%
            echo by %username% on %computername%
          )
          
          start ""/b /w /MIN NOTEPAD.exe /P "%$$$dt%"
          
          > nul ping -n 4 localhost
          del "%$$$dt%"
          \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


          • #6
            Re: batch file that prints timestamp

            Show off

            Originally posted by Rems View Post
            In addition, you could also start notepad minimized
            Code:
            @echo off
            
            Set "$$$dt=%temp%.\$$$dt"
            
            > "%$$$dt%" (
              echo This file was printed on %date% %time%
              echo by %username% on %computername%
            )
            
            start ""/b /w /MIN NOTEPAD.exe /P "%$$$dt%"
            
            > nul ping -n 4 localhost
            del "%$$$dt%"
            \Rems
            Regards,
            Jeremy

            Network Consultant/Engineer
            Baltimore - Washington area and beyond
            www.gma-cpa.com

            Comment


            • #7
              Re: batch file that prints timestamp

              ..

              .

              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