so recently I've made a function that launches my server when someone asks for it, but I don't want it to disrupt me while I'm playing, let's say,
Is there any way to start the server seamlessly ?
I use this BAT file to launch it through python.
cd C:\Users\MYUSERNAME\OneDrive\Bureau\Serv\Xection
java -Xmx4096M -Xms4096M -jar server.jar
Thanks in advance
EDIT : Stupid question, you just need to add "nogui" after server.jar
i would suggest using autoit scripting.here is a oneliner that will start your program hidden.Download autoit from here.after downloading autoit,create a file named whatever.au3 and past the following code with your path.
Run("Your program path", "", #SW_HIDE)
just run the script and it will start the executable hidden as a process.
Related
I am currently attempting to use FileZilla Pro CLI on a Windows machine to connect and upload to a site in that is working in the Site Manager.
The issue is, the command below works perfectly when pasting it directly into the cmd line. However when saving it as a batch file, it simply just gets to the fzcli> prompt and then nothing happens.
The two line breaks are on purposes to override the requirement for a password and it works perfectly when pasted in.
Does anyone know if this is a cmd line issue, or if my commands need to be different to work in batch file mode?
fzcli
connect --site 0testsite01
put C:/inetpub/wwwroot/websites/sftp/files/customer/test-01.txt /test-sftp/testuser01/test/test-01-uploaded.txt
PAUSE
Your batch file executes fzcli in an interactive mode. The fzcli then waits for you to interactively enter the commands. Only after you would exit the fzcli, the batch file would continue. And fail, as it will try to execute connect as a batch file command. The fzcli does not know about the batch file. Nor does the batch file interpreter know about the fzcli commands.
It's a common misconception. You will find plenty of similar questions basically about scripting any tool that has its own commands. For example: sftp, ftp, psftp, winscp.
To provide commands to fzcli, it seems that you need to use --script switch. The fzcli documentation gives this example:
fzcli --mode standalone --script C:\Scripts\script-file
The issue
I am trying to create a batch file that will execute the following two commands:
cd /some/path
dotnet run
that produces the following output:
It starts my localhost server.
Trying To Accomplish
What I would like to do is, put those two commands in a batch file and automatically open Chrome to the server address, HOWEVER, the dotnet command takes some time to finish. So somehow, I would have to keep monitoring localhost to see if it is available.
Any help would be appreciated. Although opening a CMD window, typing those 2 commands, and waiting a minute isn't all that much of a problem, it sure would be nice to just click on a batch file.
Thank you.
You can create a batch file like this code :
#echo off
Set "ApplicationPath=%UserProfile%\source\repos\PruttPos\PruttPosSystem\"
CD /D "%ApplicationPath%"
dotnet run
Start "Chrome" Chrome.exe "http://localhost:5000"
pause
I am trying to run a bat file to start a server as follows:
cd c:\...\bin
call asadmin start-domain
This should start the server. It works great with command prompt, but it is not working when I am using the same commands with Jenkins. It is a freestyle project.
When I run the build it says "attempting to the start domain..." and then completes the build with status "success", but the server is still not started.
I would be grateful, if someone could guide me in this regard.
Thank you in advance,
Fred
I'm doing a batch file to unify all the Phonegap commands to create an app. All seems work well, but after the command phonegap create appName my cmd stops the batch script and doesn't continue working. I suppose that Phonegap's commands finish with an "exit" or similar, but I'm not sure.
Does someone know if there is any way to run this commands in a batch file without this problem? Is there any way to return the control to the batch script?
Thanks!
Try this:
call phonegap create appName
I tried using CALL to start Google Chrome then immediately return control to the console, but it wasn't returning to the console. (Windows 7, not in command prompt but using a *.cmd file)
I solved the case by using START:
START "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
So I am starting a consol program from .bat file. I want it to run as a process but not showing any windows. How to do such thing?
I think the start command with a '/B' option should do it ...
Windowless:
#echo off
start /B Myapp.exe
Minimized:
#echo off
start /MIN Myapp.exe
I'm not sure if I understand what you mean: if you run a console program from a .bat/.cmd script, that program will use the existing console window, not create a new one.
I suspect what you're really asking is how to prevent Explorer from opening a console window for the .bat/.cmd script itself. There's no built-in way to do that (although as amir75 suggested, you can mitigate it by running the script minimized; instead of running the script directly, create a shortcut to it and edit the shortcut's properties).
Alternatively, you can run your script through the silentbatch program that Paul Miner and I wrote.