When I run this, command window shows up and lngErr = 42
lngErr = ShellExecute(0, "runas", "cmd.exe", "", "", 3)
But when I run this, nothing happend and lngErr = 2
lngErr = ShellExecute(0, "runas", "compmgmt", "", "", 3)
Any suggustion? Thanks
Technology Tips and News
When I run this, command window shows up and lngErr = 42
lngErr = ShellExecute(0, "runas", "cmd.exe", "", "", 3)
But when I run this, nothing happend and lngErr = 2
lngErr = ShellExecute(0, "runas", "compmgmt", "", "", 3)
Any suggustion? Thanks
Hi,
Based on my research, if the function succeeds, it returns a value greater than 32. If the function fails, it returns an error value that indicates the cause of the failure.
Quote from:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx
So I think the first code seems to be successful.
And if you want further help, please post the case in Microsoft Office for Developers:
http://social.msdn.microsoft.com/Forums/en/category/officedev