I noticed that the PRINT command doesn't work well when running scripts from the task scheduler.
The reason for that is because it's running in batchmode.
What you want is an interactive session.
Here's how, the easy way without the annoying RDP stuff:
Download PsExec from Microsoft here:
http://technet.microsoft.com/en-us/sysi ... 97553.aspx
Drop the executable into your system32 folder (or other executable path)
Using notepad, create a new file with the following text. Save as C:\runtask.cmd
Code: Select all
imacros -macro YourMacroToRun
2.Right click on the 'Task Scheduler' application and select 'Run as administrator'
3.Using the 'Action' pane select 'Create Task'
4.Under 'Name' enter an appropriate name (for example, "Run My Macro")
5.Click on the Change User or Group button
6.Enter the name of Users and click OK
7.Select the 'Triggers' tab
8.Click on the 'New' button
9.Enter in the appropriate time (for example, daily - 6pm)
10.Select the 'Actions' tab
11.Click on the New button
12.Under Program/script enter psexec
13.Under Add arguments enter -i C:\runtask.cmd
*(I added the -i switch, opposed to the picture below as i think it's correct)
15.You can confirm the settings by right clicking on the new task and selecting 'Run'
If setup correctly the application will run at the specified time (assuming the computer is turned on and a user is logged on). The application will appear on the screen for the logged on user.
*All credit for this info goes to Adrian at mockbox.net:
http://www.mockbox.net/windows-7/473-wi ... eractively