Hello,
I would like to at certain time of day open the same document and print. I can do that with script but It doesn't run if the computer is logoff
Thank you
everyday logon and print
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: everyday logon and print
Hi,
I think this article might answer your question : https://help.mjtnet.com/article/14-why- ... logged-out
I think this article might answer your question : https://help.mjtnet.com/article/14-why- ... logged-out
Yes, we have a Custom Scripting Service. Message me or go here
Re: everyday logon and print
Hi timle,
Though its true that UI events can't be performed while your screen is locked, non-UI events can. If you can find a way to print your documents from a command line they can be printed while the screen is locked. To demonstrate, the following script will lock your screen and print a test document to your default printer while the screen is locked using WordPad. Wordpad can also print .doc and .docx files. Also note there is a difference between "logged off" and "locked screen". If you are logged off, your user session is not running so none of your applications, including Macro Scheduler, are not running. Command line printing will only work if you are "logged in" but your screen is locked like in the case of pressing WinKey + L.
Though its true that UI events can't be performed while your screen is locked, non-UI events can. If you can find a way to print your documents from a command line they can be printed while the screen is locked. To demonstrate, the following script will lock your screen and print a test document to your default printer while the screen is locked using WordPad. Wordpad can also print .doc and .docx files. Also note there is a difference between "logged off" and "locked screen". If you are logged off, your user session is not running so none of your applications, including Macro Scheduler, are not running. Command line printing will only work if you are "logged in" but your screen is locked like in the case of pressing WinKey + L.
Code: Select all
//Will lock workstation. Same as pressing WinKey+L
RunProgram>cmd /c rundll32.exe user32.dll, LockWorkStation
//
//Wait for screen to be locked.
Wait>10
//
DeleteFile>%desktop_dir%\test.rtf
//
//Save TEST.RTF file to desktop
LabelToVar>Testing,vdata
WriteLn>%desktop_dir%\test.rtf,wres,vData
Wait>1
//
//Print the file from command line using WordPad
//Wordpad will also print .DOC and .DOCX files
RunProgram>C:\Program Files\Windows NT\Accessories\Wordpad.exe %desktop_dir%\test.rtf /p
//
//
/*
Testing:
{\rtf1\ansi\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Riched20 10.0.18362}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang9 This is a test\par
\par
}
*/
Re: everyday logon and print
thank you