我有一个代码可以取消隐藏可移动驱动器中的所有文件
//buffer is the removable drive letter
PWSTR show = L"/k attrib -s -r -h *.* /s /d /l ";
ShellExecute(NULL,L"open",L"cmd.exe",show,buffer,SW_HIDE);
此代码成功运行,但执行此操作后,我无法弹出可移动驱动器。
它显示以下消息
即使我关闭我的程序,它也会显示此消息。当看到任务管理器时,我发现我的驱动器I:\正在后台运行,我现在应该怎么做才能解决这个问题
答案 0 :(得分:6)
开关/k
使cmd.exe
运行命令然后坐在那里等待进一步的指示。
您的shell窗口仍在那里,在后台隐藏,位于I:
。
将/k
替换为/c
。
/C Run Command and then terminate /K Run Command and then return to the CMD prompt. This is useful for testing, to examine variables