09-13-2016 06:49 PM
In the past I have successfully used cmd /c in my code with such example as
LaunchExecutableEx (cmd /c format r: /fs:ntfs /q /y, LE_HIDE, &handle);
But now under windows 10, I get the error message:"access denied as you do not have sufficient privileges. You have to invoke this utility running in elevated mode."
So how should I temporarily get to elevated mode to execute this in-line command, then subsequently exit elevated mode?
09-14-2016 04:34 PM
Can you "Run as Administrator" or ask your server provider to allow you to have adminstrator privileges?
09-24-2016 10:03 PM
Roxanna,
I have found a solution to this issue. Note that Win 10, 64 bit has become strict in requiring previleges with certain operations such as formating a drive. In CVI the LaunchExecutableEx( ) function no longer works adequately in a quiet, hidden way with such example as:
LaunchExecutableEx("cmd.exe /C format R: /fs:ntfs /q /y", LE_HIDE, &handle);
I came across a program called elevate.exe as referred to the link: https://jpassing.com/2007/12/08/launch-elevated-processes-from-the-command-line/ that places the command line in elevated mode prior to launching the format command. Source code is provided at this link. The elevate.exe accomplishes the elevation by doing a shell execution. The expression now becomes:
LaunchExecutableEx("elevate cmd.exe /C format.com R: /fs:ntfs /q /y:, LE_HIDE, &handle);
Conclusion: For WIn 8, Wind 10, and onward the LaunchExcutableEx( ) function needs to be upgraded with an optioned ability to raise to elevated mode for the launch of an executable. The development team should become aware of this.
Regards,
Steve Macha
Mikrokraft, Inc., c/o Cooper Consultaing Service, an alliance partner
smacha@windstream.net
10-13-2016 03:30 PM
Hi Steve,
Thank you so much for the feedback. I will bring them in on the loop about this.