windows - Calling a .bat file from Java in a restricted (Citrix) Environment -
i'm not familiar programming windows desktop , i'm trying figure out how handle calling .bat files java. i'm trying make desktop java program using maven run jar file execute bash script in citrix virtualization environment.
the original initial problems unc paths causing batch file not found, i've modified paths , i'm able find batch file, cmd.exe disabled in citrix account i'm using, , worried there's nothing can do.
here's how works:
1) user launches program via program.jar file user checks updates
2) if updates found, new jar file called program_update.jar
downloaded, , batch file called run_update.bat
copied main program directory.
3) within java program, following command called:
runtime.getruntime().exec("cmd /c pushd " + filename.installation + " && start run_update.bat && popd");
where filename.installation
property has been previous set indicating home installation directory.
run_update.bat
runs loop attempting replace program.jar
program_update.jar
, show success/fail message in command prompt.
when run in citrix environment, following message:
'run_update.bat' not recognized internal or external command, operable program, or batch file.
the command prompt has been disabled administrator.
at point, can click on run_update.bat
, runs operation successfully.
the automatic update called via program.jar works in normal windows environment access cmd.
my questions
- is call java run
cmd /c <commands>
not going work when cmd.exe disabled? - would renaming run_update.bat run_update.cmd good?
- any alternative techniques? batch file necessary afaik because jar file replacing via
mv
command.
wiki
Comments
Post a Comment