Quick and simple question: I have a batch file that calls for some .exe like so:
START /WAIT GVE %opt%
My problem is that the program starts in a new console, is their anyway to make it start in the same console ? I've tried /NOCONSOLE option without success.
Thanks
I think you just need the /B option (assuming the exe is a console app)
start "" /b /wait gve %opt%
Related
So i'm writing on a Batch Script to Optimize Games and i found the following way to start Games from Epic Games in cmd:
start "" "com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102%3A6e563a2c0f5f46e3b4e88b5f4ed50cca%3A9d2d0eb64d5c44529cece33fe2a46482?action=launch&silent=true"
This is now for GTAV and it works fine typing it manually in cmd however as soon when i put it in a Batch Script it just opens the Epic Games Window but doesn't start the Game.
I also tried to run the command in a seperate cmd window like that:
start cmd.exe "start "" "com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102%3A6e563a2c0f5f46e3b4e88b5f4ed50cca%3A9d2d0eb64d5c44529cece33fe2a46482?action=launch&silent=true""
But it still does nothing. It just says that it can't find silent or it's written wrong.
Also the echo shows that are spaces in the command now:
start cmd.exe "start "" "com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102A6e563a2c0f5f46e3b4e88b5f4ed50ccaA9d2d0eb64d5c44529cece33fe2a46482?action=launch & silent=true""
Maybe someone else knows what's wrong or why it doesn't work?
Instead of using the Url use the shortcut .url file created by epic launcher, in my case the shortcut is saved on Desktop with file name "Game Name.url".
#echo off
cd "C:\Users\username\Desktop"
start "" "Game Name.url"
exit
It also auto launches Epic Launcher if not running.
Note: Remove any special character in file name if present.
My skills with cmd are rusted and I cant recreate this specific code, but did you try:
start "com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102A6e563a2c0f5f46e3b4e88b5f4ed50ccaA9d2d0eb64d5c44529cece33fe2a46482?action=launch"
::epic games
::check if EpicGamesLauncher.exe is running already
tasklist /fi "ImageName eq EpicGamesLauncher.exe" /fo csv 2>NUL | find /I "EpicGamesLauncher.exe">NUL
if "%ERRORLEVEL%"=="1" (
::start epic games itself
:: has to be opened like a website link
start "" com.epicgames.launcher://apps
::clears screen not to confuse user during timeout due to weird start command error ("The system cannot find the drive specified.")
cls
echo EpicGamesLauncher.exe is NOT running!
echo Starting Epic Game Launcher...
:: waits x seconds for epic launcher to load
TIMEOUT /T 15
)
::this will start if epic games is open, if not it will just open epic games itself, need double %% because this is a batch file
::com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102%3A6e563a2c0f5f46e3b4e88b5f4ed50cca%3A9d2d0eb64d5c44529cece33fe2a46482?action=launch&silent=true
start "" com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102%%3A6e563a2c0f5f46e3b4e88b5f4ed50cca%%3A9d2d0eb64d5c44529cece33fe2a46482?action=launch&silent=true
exit
Since this was modified 2 months ago, i hope someone will still see this:
The batch command is the following:
START "" "A:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win64\EpicGamesLauncher.exe" com.epicgames.launcher://apps/0584d2013f0149a791e7b9bad0eec102:6e563a2c0f5f46e3b4e88b5f4ed50cca:9d2d0eb64d5c44529cece33fe2a46482?action=launch&silent=true
The first "" is just a title for the new "window" you're creating. If not provided the cmd will think the exe will be the title and the url the right programm to start. Just bad style
The EpicGamesLauncher.exe will be the right programm to start. I found it with help of the first answer of this question. Just look for the "com.epicgames.launcher" protocol.
The third part u get by creating a Shortcut to your game in eg. (RMB on Game -> Manage -> Create Desktop Link) Then go in the shortcut properties and under webdocument you can find the url property. This is the third part but you need to decode the url encoding. For GTA i had multiple "%3A" in it, this translates to a simple ":".
It works on my Win10 maschine. And i hope it will work on your maschine as well.
To recreate my problem you need to understand that I have next files in 2 folders.
K:\Script.bat
K:\Project\PortChanger.exe
K:\Project\settings.xml
I want to launch PortChanger.exe using Script.bat that contains next line:
start "K:\Project\PortChanger.exe"
This script is actually executing Program.exe, but my program throws me exception since PortChanger.exe can't find Settings.xml.
How can I launch PortChanger.exe from "K:\Project\", not from "K:\"? Now it seems like .BAT taking .EXE code and just running it where .BAT is locating.
To make it even more clear:
You could use Start with its /D option:
Start "" /D "K:\Project" "K:\Project\PortChanger.exe"
Open a Command Prompt window and enter start /? to read its usage information.
I would suggest you rather use pushd and popd
#echo off
pushd "K:\Project"
start "" PortChanger.exe
popd
pushd will change to the directory, launch the executable from it, then popd will return to the previous directory stored.
I'm writing a windows batch script to start my Java program in the background, using javaw.
The issue comes when I let the user have a custom path to the Java Home. Let's say in an example when the path to Java home is: C:\Users\Sample User\Desktop\java (notice the space in the path), when I try running the start command, it breaks because of the spaces.
Example:
#echo off
set CUSTOM_JAVA_HOME=C:\Users\Federico Einhorn\Desktop\java
set CP=myjar.jar;../lib/*;.
set JAVA_PARAMS=-myOption -Xmx1024M -classpath %CP%
set JAVA_CLASS=com.myorg.MyClass
set RUN_OPTS=%JAVA_PARAMS% %JAVA_CLASS% start
start /b "%CUSTOM_JAVA_HOME%/bin/javaw" %RUN_OPTS%
That start command fails as the CUSTOM_JAVA_HOME has spaces.
Windows cannot find '-myOption'. Make sure you typed the name
correctly, and then try again.
This doesn't happen when I run my jar with regular java:
"%CUSTOM_JAVA_HOME%/bin/java" %RUN_OPTS%
Is there a way to solve this?
Start sees "%CUSTOM_JAVA_HOME%/bin/javaw" as a title.
The fix is to include a title yourself, even a blank one:
Start "" /B "%CUSTOM_JAVA_HOME%\bin\javaw" %RUN_OPTS%
I have a bat called launch.bat and ChromePass.exe in the same folder.
The bat:
chromepass.exe /stext output.txt
When executed, all it does is open the program in a new window and does not create the text file.
How can I make it so the program runs silently and actually outputs the text file?
This is because the developer (nirsoft.net) has removed the command-line options from the official releases as they were usually used by viruses to steal passwords from users without them knowing.
Original blog-post: http://blog.nirsoft.net/2014/09/22/command-line-options-removed-from-the-official-release-of-my-password-recovery-tools/
call ".\chromepass.exe" /stext .\output.txt
or
.\chromepass.exe /stext .\output.txt
Try one of those in command prompt.
try this /stext "readme.txt" it works perfectly on my windows 10
I hope when this code has run, you can get the solution of this problem
#echo off
start WireView.exe /stext WireView.txt
or
#echo off
start WireView.exe > WireView.txt
I'm trying my hand at some light programming, but have hit a wall I'm hoping someone can help me with. I'm using an HTPC and a front end media center called Kodi. Within Kodi I have a program called advanced launcher. As my MC Kodi is scripted to always be on top, I've been using a batch file for each PC game and program I'm trying to run. It shuts down Kodi, launches the program, and when the program is closed, relaunches Kodi. This works fine for most programs, but if it has a launcher attached (the example I have is for Dragon Age: Inquisition and the launcher it has Origin) it will run straight through the entire batch file without waiting as I thought I had instructed it. This only seems to happen in programs that have launchers. As I'm just starting out, while lines to change or add would be great to get this working, I'd also like to know the reason behind the changes.
pskill Kodi.exe
cd /d "I:\Games\Dragon Age Inquisition\"
start /max /wait Dragon Age Inquisition.exe
ping 192.168.1.46 -n 1 -w 15000 > nul
cd /d "C:\Program Files (x86)\Kodi\"
start /max Kodi.exe
Ps Commands were recommended by a friend, not sure if this is also an issue, just seems odd that any program without a launcher works fine, but with a launcher just doesn't seem to function correctly. Thanks for your valuable time.
try with:
start "" /max /wait Dragon Age Inquisition.exe
and
start "" /max Kodi.exe
First argument is always the title.
Taskkill /im Kodi.exe
"I:\Games\Dragon Age Inquisition\Dragon Age Inquisition.exe"
"C:\Program Files (x86)\Kodi\Kodi.exe"
Should work how you expect.
Taskkill is the correct command. Use it with /f to force closing.