最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Dialog box for a user with an active session - Stack Overflow

programmeradmin3浏览0评论

My task is to update a program on users' computers. I will do this by running a script on behalf of the system account via the task scheduler.

But before starting the procedure of deleting and installing a new version, I want to get confirmation from the user that this can be done right now (the program will be closed).

I thought to send them a dialog box via Windows Forms MessageBox, but I can't open the form in another user's session.

How can this be done?

Tried System.Windows.Forms.MessageBox. Sent notification via msg.exe - can't process user response result

For example, open a dialog box in a script:

[System.Windows.Forms.MessageBox]::Show($FrmMain,"Install now?", "Title", 4, 32)

I will run the script through the task scheduler on behalf of SYSTEM. But I need the form to open in the user session that is currently open and not in the SYSTEM session.

发布评论

评论列表(0)

  1. 暂无评论