I currently have a group policy startup script (CMD file). It runs during startup, as expected, but there is no UI for the program the script invokes.
For example purposes, let's say I have this command as my startup script:
rundll32 shell32.dll,ShellExec_RunDLL "C:\Windows\System32\notepad.exe" echo foo > C:\foo.txt
^ This invokes "Notepad" to run, and writes output to a textfile (foo.txt). Pretty simple. When group policy runs this script, the text file is produced and Notepad is running. The problem is that Notepad has no UI. The only way I can tell it is running is through Task Manager/Processes. I have verified it working, but I need Notepad to show up in my taskbar, while running.
...According to TechNet/Microsoft here: Assign computer startup scripts w/ Microsoft
Startup scripts are run as Local System, and they have the full rights that are associated with being able to run as Local System.
My problem is that I really need the Notepad program UI to display and cannot seem to make this happen when it runs under "Local System".
- Is there a way to have my startup script run as Administrator? Or is there a way to enable Local System user to have necessary priveleges to fully run Notepad?
- Do I need to alter my CMD script to "RUN AS" a different user?
- Should I ditch group policy for scheduled tasks? Scheduled tasks are easier to setup. it seems like a toss-up to me?
I would like to point out that I have also tried this with "Scheduled Tasks" under Control Panel/Administrative Tools. I have the same results and same situation, where my script runs successfully but Notepad UI is never displayed. I am open to suggestions using Task Scheduler as well, or different approaches. Thanks!