通过SetTokenInformation(TokenSessionId),我可以设置我的程序在Session0运行吗? [英] by SetTokenInformation ( TokenSessionId), could i set my program to run at Session0??

查看:1119
本文介绍了通过SetTokenInformation(TokenSessionId),我可以设置我的程序在Session0运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:Vista~Win10


我想在Session0上运行我的程序,但我不想将它作为服务运行,这可以存档吗?


因为我看到了SetTokenInformation(xx,TokenSessionId,xx,xx),我已经获得了系统特权,因为我可以设置


TokenSessionId = 0来实现那个??




Marcus

解决方案

如果您使用System或LocalService帐户从任务计划程序启动程序,它将在会话0中运行。 但是,用户界面将无法在桌面上显示。


尝试更改当前进程令牌的TokenSessionId会返回令牌已被使用的错误。


OS:Vista~Win10

I want to run my program at Session0 ,but I dont want to run it as service , is this archivable ??

Since i saw SetTokenInformation(xx,TokenSessionId,xx,xx) , I already get System privilege,

here could i set TokenSessionId=0 to achive that ??


Marcus

解决方案

If you start your program from the Task Scheduler using the System or LocalService account it will run in session 0.  However, the UI will not be visible on your desktop.

Attempting to change the TokenSessionId for the token of the current process returns an error that the token is already in use.


这篇关于通过SetTokenInformation(TokenSessionId),我可以设置我的程序在Session0运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆