I would like to code the following :

In a windows server 2012-R2 administrator account, I have a my java application which launches an external application to run in a restricted user account. My java application also changes the user account windows permissions (read/write) as required.

1- Is it possible to launch an external application from a java processBuilder in one account and run the application in a different windows account?

2- Is it possible to change a windows server 2012-R2 users permission from java? only through a PS script?


1 Answer 1


Launch an External Application

You can use ProcessBuilder to start a Process where PSExec is used to execute processes as a different user.

psexec.exe -u username -p password foo.exe


Change a Windows Server 2012 R2 User's Permission

For executable file, you can use Icacls.


For PowerShell script, you can use Get-NTFSAccess, Add-NTFSAccess and Remove-NTFSAccess.


  • you're a champ!
    – Guigui
    Feb 27, 2017 at 0:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .