SyMenu Forum

SyMenu

 

HomeConfigure portable programs

How to configure programs in SyMenu

launch script silently Messages in this topic - RSS

jsjsjsjs
jsjsjsjs
Posts: 3


28/05/2013
jsjsjsjs
jsjsjsjs
Posts: 3
Hi, see how I launch script silently

In this case :
path : ..\DeepBurner1_Portable\DeepBurner.bat

I use VB script to do this :

path : wscript.exe
additionnal parameter : #:\Applications\silentmode.vbs DeepBurner.bat
advenced work repertory : ..\DeepBurner1_Portable\

this is the content of my silentmode.vbs :
---------------------------
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, False
--------------------------
work with xp, vista, seven
link
Gianluca
Gianluca
Administrator
Posts: 1274


28/05/2013
Gianluca
Gianluca
Administrator
Posts: 1274
Thank you for your trick I can finally discard the old annoying command window.

For example this is my new TCM launcher.

path: wscript.exe
additional parameters: #:\SyMenu\SilentMode.vbs "#:\SyMenu\ProgramFiles\Totalcmd\TOTALCMD64.EXE" /i="#:\SyMenu\ProgramFiles\Totalcmd\wincmd.ini" /F="#:\SyMenu\ProgramFiles\Totalcmd\wcx_ftp.ini"
working directory: .\ProgramFiles\Totalcmd
link
kj
kj
Posts: 6


13/06/2021
kj
kj
Posts: 6
Thanks! Took me half-day to look for solution. Didn't realize there is same similar in this forum.

Gian, I'm still not quite understand on the parameters on working directory, etc.

To make things simple, should I actually be specifying working directory for all SPSapps? And does this parameter works for other apps which are portable in nature due to no other dependencies not present in the OS?

If this works, what is your recommended settings that I can just copy paste to all the params field boxes. haha.

Have completed my custom menu. Now is to fine-tune on the working folders lest it not too confusing for my family members.
link
Gianluca
Gianluca
Administrator
Posts: 1274


14/06/2021
Gianluca
Gianluca
Administrator
Posts: 1274
Hi kj,
Next time please open a new thread for every argument otherwise is difficult to find the various topics for all the users.


Parameters and working dir
These are Windows concept not SyMenu ones. SyMenu allows you to add them but it's Windows that manages them.
Parameters: https://www.bleepingcomputer.com/tutorials/understanding-command-line-arguments-and-how-to-use-them/
The working directory is the directory where your program is working. If for example your program needs a file inside the relative folder .\resource this folder is resolved according with your working dir.



Should I specify the working dir?

Nope. Usually in SyMenu you don't have to specify the program's working dir because it's quite always .\, i.e. the program root folder.
One of the several exception is if you want to execute a .jar executable without Java installed.
In this case your executable is [...]\jre\bin\javaw.exe but your working dir is not [...]\jre\bin\ but the program one.

Naturally executing javaw.exe alone doesn't start your program, so you have to pass it through the parameter.

This is an example for yEd Graph Editor:
working dir: .\

Arguments: -jar [SyMenu]\ProgramFiles\SPSSuite\SyMenuSuite\yEd_Graph_Editor_sps\yed.jar

or you can execute it this way:
working dir: [SyMenu]\ProgramFiles\SPSSuite\SyMenuSuite\yEd_Graph_Editor_sps\
Arguments: -jar yed.jar



Does working dir works for other apps which are portable in nature due to no other dependencies not present in the OS?
The portability of a program and the working dir are two different concepts.



Well you are a bit confused on the various topics.
My advise is to try to progress step by step and not pretending to create a complex system by scratch.
I think your first target is accomplished (the custom menu creation).
Why not trying to play with the working dir of one single program now?

You have the double example of yEd that's really interesting and didactic.
link
biorpg
biorpg
Posts: 1


21/08/2021
biorpg
biorpg
Posts: 1
kj, You can use add the registry entries below to make it so Windows will run .jar files in their current directory by default.:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.JAR]
@="jarfile"

When using a .jar file directly(by double-clicking, or typing the name into the command prompt),
this is where Windows checks first for instructions on what to do with the file. The above just
redirects it to another key of the same format, named 'jarfile' instead of ',jar'. I have only
done that here because that is how the Java installer packages do it, and so anything else done
within this key would simply be ignored if the installer had been run.


Edit the following to match your Java path. All symbols are important, but you may only need to change the "jre1.8.0_131":
[HKEY_CLASSES_ROOT\jarfile\shell\open\command]
@="\"C:\\Program Files\\Java\\jre1.8.0_131\\bin\\javaw.exe\" -jar \"%1\" %*"

In the absence of another redirect, Windows will read the subkeys to determine how to handle the
file. The 'open' subkey under "shell" defines the default command to use. Other keys under "shell"
define additional context menu entries. Everything about how a file type is represented and used
in Windows is specified here.


Again, change to match your path:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"JAVA_HOME"="c:\\program files\\java\\jre1.8.0_131"
"JAVAPATH"="C:\\Program Files\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\ProgramData\\Oracle\\Java\\javapath"



https://docs.microsoft.com/en-us/windows/win32/shell/fa-verbs

edited by biorpg on 21/08/2021

Attachments:
java.reg
link



UGMFree © 2002-2024
PayPal BTC TON