看帖神器
北美华人网
追帖动态
头条新闻
每日新帖
最新热帖
新闻存档
热帖存档
文学峸
虎扑论坛
未名空间
北美华人网
北美微论坛
看帖神器
登录
← 下载
《看帖神器》官方
iOS App
,体验轻松追帖。
微软 Copilot 怎么也写不出 这个 关机 的 cmd 代码
查看北美华人网今日新帖
最新回复:2025年7月3日 15点47分 PT
共 (2) 楼
返回列表
订阅追帖
只看未读
更多选项
阅读全帖
只看图片
只看视频
查看原帖
b
baidukaohe333
6 天
楼主 (北美华人网)
You want: - ✅ A visible Yes/No message box. - ✅ A system shutdown if nothing is clicked within 60 seconds. - ✅ Cancellation only if the user explicitly clicks “No”. Clicking "Yes" shuts down righ away. 这个是 它给的 最接近的代码, “是” 和 “否” 按键都有效,但 60 秒后 不会自动关机。
powershell -NoProfile -WindowStyle Hidden -Command ^ Add-Type -AssemblyName PresentationFramework; ^ $timer = [System.Threading.Timer]::new({ shutdown /s /t 0 }, $null, 60000, [System.Threading.Timeout]::Infinite); ^ $result = [System.Windows.MessageBox]::Show( ^ ''''The system will shut down in 60 seconds. Click YES to shut down now, or NO to cancel.'''', ^ ''''Confirm Shutdown'''', ''''YesNo'''', ''''Warning''''); ^ $timer.Dispose(); ^ if ($result -eq ''''Yes'''') { shutdown /s /t 0 } elseif ($result -eq ''''No'''') { shutdown /a }
哪位能帮忙问问 chatgpt?
b
baidukaohe333
6 天
2 楼
改变了问问题的方法,先问简单的,再加功能,貌似做出来了。
请输入帖子链接
收藏帖子
powershell -NoProfile -WindowStyle Hidden -Command ^ Add-Type -AssemblyName PresentationFramework; ^ $timer = [System.Threading.Timer]::new({ shutdown /s /t 0 }, $null, 60000, [System.Threading.Timeout]::Infinite); ^ $result = [System.Windows.MessageBox]::Show( ^ ''''The system will shut down in 60 seconds. Click YES to shut down now, or NO to cancel.'''', ^ ''''Confirm Shutdown'''', ''''YesNo'''', ''''Warning''''); ^ $timer.Dispose(); ^ if ($result -eq ''''Yes'''') { shutdown /s /t 0 } elseif ($result -eq ''''No'''') { shutdown /a }
哪位能帮忙问问 chatgpt?