我需要运行在AutoCAD/ZWCAD中需要提升权限的应用程序。
通过LISP,我可以使用以下方法运行应用程序:
(startapp "C:\\[path]\\Application.exe")但是对于需要电梯操作的应用程序,startapp返回nil,而应用程序不运行。
也曾尝试:
(setq Shell (vlax-get-or-create-object "Wscript.Shell"))
(setq updater(vlax-invoke-method Shell 'Exec (strcat path "Appname.exe" ) ) )
(vlax-release-object Shell)但我得到了:
*error*: Automation error : WshShell.Exec : The requested operation requires elevation.那么,运行外部应用程序的其他方式是否需要更高的权限呢?
发布于 2020-03-25 12:18:44
我发现在LISP和C++ ObjectARX中都可以这样做:
LISP:
(startapp "C:\\[path]\\run.bat")在run.bat中
CALL "C:\[path]\Application.exe"在我的网站上工作正常
ObjectARX C++
CString AppPath = _T("C:\\[path]\\");
CString App = AppPath + _T("Application.exe");
HINSTANCE aplication = ShellExecute(0, _T("open") , App , NULL , AppPath , SW_SHOWNORMAL);发布于 2020-03-02 16:50:29
也许你可以试试RunAs
(startapp "runas /user:administrator C:\\[path]\\Application.exe")当然,您将被提示输入密码。
您可以在这里找到替代方案:https://superuser.com/q/55809/60438
https://stackoverflow.com/questions/60491014
复制相似问题