# UAC Prompt for Jars

#### bignose956

##### Senior Member
Is it possible to show a UAC prompt for a Java jar file? I am aware that one can edit an executable's manifest to require an elevated process, but there seems to be no way to do so with a Jar file. I do not want to edit javaw.exe's manifest.

Is there a specific file that that can take file path arguments to show a UAC prompt? Or do I have to learn powershell? Or is there a better solution?

#### Neemobeer

##### Cyber Security Engineer
Staff member
Can't do it with straight up java. You'll either want to use a script (powershell or vb script) or create a wrapper executable with a manifest requiring elevation.

#### Neemobeer

##### Cyber Security Engineer
Staff member
Running it from powershell would simply be

Start-Process -FilePath "C:\path\to\java.exe" -ArguementList "-jar path\to\file.jar" -Verb "RunAs"

#### bignose956

##### Senior Member
Running it from powershell would simply be

Start-Process -FilePath "C:\path\to\java.exe" -ArguementList "-jar path\to\file.jar" -Verb "RunAs"
I've never used powershell, so I'm not sure how to resolve this error:

#### Neemobeer

##### Cyber Security Engineer
Staff member
Had a typo -ArugmentList

#### bignose956

##### Senior Member
Had a typo -ArugmentList
Ohhh! I see it now. One more problem. The path to said Jar has spaces in it, thus it is getting split in half as separate arguments. How should I change it?
Code:
"-jar C:\Users\Firstname Lastname\Desktop\Java Program.jar"
^                     ^

#### Neemobeer

##### Cyber Security Engineer
Staff member
Single quote the path
"-jar 'C:\Users\Firstname Lastname\Desktop\Java Program.jar'"

Replies
0
Views
285
Replies
0
Views
265
Replies
0
Views
57
Replies
0
Views
144
Replies
0
Views
351