Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: Can't seem to set the run only when logged in in Windows 10

$
0
0
Hello all,

I did try the following code lines:

string currentUser =
                System.Environment.GetEnvironmentVariable("USERDOMAIN") +
                @"\\" +
                System.Environment.GetEnvironmentVariable("USERNAME");
td.Principal.UserId = currentUser;
td.Principal.LogonType = TaskLogonType.InteractiveToken;

but I still have the run whether user is logged in or not option selected.

Thanks in advance for help :)

Bob

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>