在windows7上从windows Service执行Notepad.exe时出现问题

Issue executing Notepad.exe from windows Service on windows7

本文关键字:exe 问题 Notepad 执行 windows7 上从 windows Service      更新时间:2023-10-16

我已经创建了windows服务,它在noteapad.exe上执行ShellExecute命令。当服务安装时,notepad.exe被执行,只在任务管理器中看到。记事本.exe窗口不可见。谁能让我知道这可能是什么问题,我已经在Windows XP上试过了,它工作得很好。

下面是ShellExecute 的代码
::ShellExecute(NULL,
        NULL,
        _T("notepad.exe"),
        _T("C:\Users\testuser\Desktop\review_comments.txt"),
        _T("C:\Windows\System32"),
        SW_SHOWMAXIMIZED);

Thanks in advance

从Vista和Windows Server 2003开始,服务不再允许显示窗口。(执行的记事本仍然属于服务…)

hth

马里奥