Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: User-created (sch)tasks Invisible When Run

10 Nov 2012   #1

Windows 7
User-created (sch)tasks Invisible When Run

On startup several tasks are added to schtasks via a GPO startup script:
schtasks /create /xml "X:\task 1.xml" /ru "COMPUTER NAME\USER NAME" /rp PASSWORD /tn "Imported Task 1"

Via a batch script in Programs\Startup these tasks are then run:
schtasks /run /tn "Imported Task 1"

Although the programs launched by the tasks all run (as the user), they run invisibly and can not be seen (by the user) in Task Manager unless "Show processes from all users" is clicked.

The tasks were set to "run only when the user is logged on" when they were exported, but after importing they are all set to "run whether the user is logged on or not".
By ending the processes of the tasks in Task Manager, ending the tasks in Task Scheduler and resetting them to "run only when user is logged on" and then running them, the tasks run visibly as intended.

Is there any way to force/import/set tasks to "run only when user is logged on" (from the command line)?

My System SpecsSystem Spec
12 Nov 2012   #2

Windows 7

I managed to resolve the situation. This solution is only for trusted environments.

See next post for a better solution.

My particular scenario is somewhat complicated. Without going into detail, the computer is locked-down (running Returnil, similar to Steady-State) and the software is virtualized (Symantec Workspace Virtualization). I had the GPO startup script and a non-elevated batch file which is run on startup to play with.

As the user account has no password it was difficult to import a task with elevated privileges intended to run visibly.

Via the GPO script a temporary password was created*1, the tasks then imported with an /it switch to run them interactively*2 and the password removed*3. The tasks were then started from the script*4. (The tasks were delayed (with NirSoft's nircmd) so the virtualized layers had time to load.*5 The layers themselves are loaded with delay too, earlier, to give them some time.)

*2 schtasks /create /xml "X:\Task.xml" /ru USERNAME /rp PASSWORD /tn TASKNAME /it
*3 net user USERNAME ""
*4 schtasks /run /tn TASKNAME
(*5 nircmd cmdwait 6000 exec hide schtasks /run /tn TASKNAME)

Some issues emerged as a result of the temporary password. An environment variable called SEE_MASK_NOZONECHECKS with a value of 1 was created to prevent Open File - Security Warnings*6 and network passwords were cached to prevent network password dialogs*7. I placed these commands in the non-elevated startup.bat, as they didn't work from the GPO startup script.

*6 cmdkey /add:COMPUTERNAME /user:USERNAME /pass:""
My System SpecsSystem Spec
13 Nov 2012   #3

Windows 7

Rems of suggested a better solution:

Provided the exported task was created without using a password, schtasks /create /xml FILENAME /tn TASKNAME will not only import the task with highest privileges, but the task can be started from a non-elevated batch file. It also prevents problems with network passwords.

Unfortunately, the Open File - Security Warnings persist for certain shortcuts. Adding .lnk to the GPO *1 would be a safer solution but, given my particular scenario and the relatively safe environment, setx SEE_MASK_NOZONECHECKS 1 remains the easiest approach.*2

*1 Google "File Open - Security Warning" GPO for more information.
*2 See previous post.
My System SpecsSystem Spec


 User-created (sch)tasks Invisible When Run

Thread Tools

Similar help and support threads
Thread Forum
I have created local User in my systems but when i login to that user
I have created local User in my systems but when i login to that user its taking user name and password, but its not loding getting logoff automaticaly, i can login through my admin login but another user its not loading. please help in this..
General Discussion
Running admin created tasks in standard user accounts
My company has recently purchased internet filtering and monitoring software which requires admin access to run. I am trying to create a scheduled task from the task scheduler which runs the software as an admin any time any non-admin user logs on. However, no matter how I configure the task, it...
General Discussion
Created admin User but can see on 'Switch User" cntrl/alt/del
Hello Interestingly on boot up I see "another user" but the picture is blank, with a frame around it (I can see through it to the boot wallpaper that I have changed to prove) .. Who is another user? Please help as I have been on the 2 days now:o
System Security
User accounts created but not able to logon - No user profile
I am a lab technician for Microsoft classes at a community college. One of our students somehow messed up his hard drive. The computer is running Windows 7 Enterprise SP1 64-bit. The system has two administrator accounts and one standard user account. I am still able to logon with those accounts...
General Discussion
created a new user but docs still saved in old user
Folks, I need your help again. Perhaps it's a trivial problem but I'd like to get it sorted. I have a new laptop, I created a user on installation, let's say Test1 (as W7 runs through the installation wizard etc). I then decided that I was unhappy with that user name, so I then created a new...
Installation & Setup

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 14:00.
Twitter Facebook Google+