我有一个可运行的jar文件,我开始
java -jar myFile.jar在Windows上。 一位客户声称他在启动应用程序时遇到了问题(这个jar文件包含在一个可执行文件中)。 我怀疑它与管理员权限有关。 所以我想在没有管理员权限的情况下运行我的jar文件以进行测试(因为这样我得到的System.out/err对于调试有很大帮助)。
我意识到我可以创建一个非管理员帐户并在那里启动应用程序,但我想知道是否有办法从管理员帐户专门启动一个jar,以便它没有管理员权限安慰。 或者:有没有办法打开一个没有管理员帐户的管理员权限的控制台?
客户使用Windows XP,因此这是我可以使用的操作系统。 (虽然如果你在像Win7这样的新Windows中有所了解,如果你也告诉我,我会很感激。)
编辑:澄清:我正在寻找这样的东西
java -jar -runWithoutAdminRights myFile.jar要么
start /runWithoutAdminRights java -jar myFile.jar或者从管理员帐户打开非管理员控制台的方法。
I have a runnable jar file, that I start with
java -jar myFile.jaron Windows. A customer stated that he had problems starting the application (which is this jar file wrapped into an executable). I have the suspicion that it has something to do with admin rights. So I'd like to run my jar file without admin rights for testing purposes (because this way I get the System.out/err which helps greatly for debugging).
I realize that I can just create a non-admin account and start the application there, but I'd like to know if there is a way to specifically start a jar from an admin account so that it doesn't have admin rights in the console. Or alternatively: Is there a way to open up a console that has no admin rights from an admin account?
The customer uses Windows XP, so this is the operating system that I can use. (Although if you know something in a newer Windows like Win7, I appreciate it if you would tell me too).
EDIT: To clarify: I am looking for something like this
java -jar -runWithoutAdminRights myFile.jaror
start /runWithoutAdminRights java -jar myFile.jaror a way to open up a non-admin console from an admin account.
最满意答案
Runas命令绝对看起来像是要走的路。
我相信这样做的方法是首先检查可用的信任级别选项:
runas /showtrustlevels
您应该得到类似以下内容:
C:\Windows\system32>runas /showtrustlevels The following trust levels are available on your system: 0x20000 (Basic User)然后,您将获取“基本用户”的值并运行类似以下内容来启动Java:
runas /trustlevel:0x20000 "java -jar myFile.jar"
The Runas command definitely looks like the way to go.
I believe the way to go about this would be to first check the trust level options available to you:
runas /showtrustlevels
You should get something like the following:
C:\Windows\system32>runas /showtrustlevels The following trust levels are available on your system: 0x20000 (Basic User)You would then take the value for "Basic User" and run something like the following to start java:
runas /trustlevel:0x20000 "java -jar myFile.jar"
更多推荐
发布评论