任务计划程序 - 当我锁定计算机时显示一条消息

发布于 2024-10-10 04:35:17 字数 514 浏览 5 评论 0原文

这就是我需要做的事情:

当我离开办公室时,我锁定我的计算机。我们应该在离开之前填写好考勤卡。我总是忘记去做。我希望在尝试锁定计算机时显示一条消息,询问我是否已填写考勤卡。

这是我所做的以及它不起作用的原因:

我在任务计划程序下创建了一个任务,其中操作=“显示消息”,触发器=“工作站锁定”。这样做的问题是,直到工作站被真正锁定后,任务才会运行,并且在再次登录之前我看不到该消息,这是毫无意义的。

如何在按 Ctrl-Alt-Del 后立即执行此操作,但在计算机实际锁定之前显示消息?

任何帮助将不胜感激。以下奖励积分:

1) 仅在下午 3:00 之后才显示该消息,因为我每天多次锁定计算机,每次都会收到该消息。下午 3:00 约束将假设我当天要离开,因此,它应该询问我是否已填写。

2) 在消息末尾显示“您想访问考勤卡站点吗?”并显示 2 个按钮,“是”和“否”。如果单击“是”,工作站的锁定将被取消,并且考勤卡站点将在我的浏览器中打开。如果单击“否”,工作站将继续被锁定。

谢谢。

Here's what I need to happen:

When I leave the office for the day, I lock my computer. We're supposed to fill out our timecards before leaving. I always forget to do it. I want a message to be displayed when I attempt to lock my computer asking me if I've filled out my timecard.

Here's what I've done, and why it doesn't work:

I created a task under Task Scheduler with action = "Display a message" and trigger = "On workstation lock". The problem with this is the task doesn't run until the workstation is literally locked and I don't see the message until I log back in again, which is pointless.

How can I do this so immediately after I press Ctrl-Alt-Del, but before my computer actually locks the message is displayed?

Any help would be appreciated. Bonus points awarded for the following:

1) Display the message only if after say 3:00pm, as I lock my computer multiple times a day and I would get the message every time. The 3:00pm constraint would assume I'm leaving for the day and therefore, it should ask me if I've filled it out.

2) At the end of the message, display "Would you like to visit the timecard site?" and display 2 buttons, Yes and No. If I click yes, the locking of the workstation is cancelled and the timecard site opens up in my browser. If no is clicked, the workstation goes on to be locked.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

栖竹 2024-10-17 04:35:17

您可以通过调用 MessageBox 弹出消息() 与 MB_SERVICE_NOTIFICATION 标志。即使登录屏幕显示,这也会导致控制台上弹出消息框......

You could pop your message up by calling MessageBox() with the MB_SERVICE_NOTIFICATION flag. That will cause the message box to be popped up on the console even if the logon screen is showing...

小女人ら 2024-10-17 04:35:17

我怀疑这是可能的。当您按 CTRL+ALT+DEL 时,Windows 会处理该按键,并且您无法查看。

您可以做的就是在桌面上放置一个锁定计算机的快捷方式,但只有在显示消息后才可以欲望。我的桌面上有一个“锁定工作站”快捷方式,它是通过以下目标实现的:

C:\Windows\System32\rundll32.exe User32.dll,LockWorkStation

您可以很轻松地编写自己的脚本,甚至可能是一个小应用程序。如果是后者,那么您只需调用从 user32.dll 导出的 LockWorkStation 函数即可。

I doubt that this is possible. When you press CTRL+ALT+DEL Windows handles that key press and you can't get a look in.

What you could do would be to put a shortcut on you desktop that locked the computer, but only after having shown the message you so desire. I have a Lock Workstation shortcut on my desktop which is implemented with the following target:

C:\Windows\System32\rundll32.exe User32.dll,LockWorkStation

You could quite easily write your own script, or maybe even a small app. If the latter then you simply need to call the LockWorkStation function that is exported from user32.dll.

难得心□动 2024-10-17 04:35:17

将操作更改为程序,运行该程序

msg 用户名消息
即:msg patrick 请记住这样做。

change the action to a program, run this program

msg username message
ie: msg patrick Please remember to do this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文