/stext command not working in Windows 10 - batch-file

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

Related

How to run batches NOT using cmd.exe (like Cmder.exe?)

I've recently installed cmder (or simply 'Commander') portable console emulator for windows, and really like the functionalities it comes with. But how can you (if at all) run batches through it like you can with the Windows command line?
The details:
If you write...
cd C:\test\
REM executeSomething.exe
Pause
... to a textfile and save it as a .bat file you can do can do pretty much anything just by double-clicking that file. I've got a work-flow where I launch a web-application through a batch file. Sometimes this applicaton launches automatically in Chrome, and sometimes it does not. In that case, I'll have to copy and paste a URL to Chrome manually. And that's a real pain. With cmder.exe that's much easier, but I'll have to manually navigate to a folder and start the application through Commander it manually without the luxury of a .bat file.
The functionality I'm trying to run automatically with cmder.exe is simply changing a folder and starting an executable file, specifically Jupyter Lab:
cd C:\jupyterlab\
jupyter lab
Pause
I've tried various approaches with:
#echo off
set CMDER_ROOT=C:\Cmder
start %CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.exe /icon "%CMDER_ROOT%\cmder.exe" /title "Homestead VM" /loadcfgfile "%CMDER_ROOT%\config\ConEmu.xml" /cmd cmd /k "%CMDER_ROOT%\vendor\init.bat cd %CD% && %~1"
as described here, but with no success. The example above does launch commander, but also raises a syntax error:
Current directory: C:\batches
Command to be executed: "C:\Windows\system32\cmd.exe" /k
"C:\Cmder\vendor\init.bat cd C:\batches && "
I'm obviously on to somehting here since I'm able to start Commander, but I'm not sure how to edit the remaining code to run the necessary steps. I do realize that the /title "Homestead VM" part just edits the title of the Commander window:
but I have no idea about the rest.
If this just isn't possible, I'm going to have to try to reassociate .bat files in Control Panel > Default Programs > Associate a filetype, but I'm hoping to avoid that.
Thank you for any suggestions!
System info:
Windows 7, 64 bit
Commander v1.3.12
Edit 1: My (failed) attempt trying to follow a suggestion from Gerhard Barnard
I've saved a file named please.cmd to C:\Windows\System32 that contains this:
#echo off
if not defined CMDER_ROOT set "CMDER_ROOT=C:\Cmder"
start %CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.exe /icon "%CMDER_ROOT%\cmder.exe" /title "Homestead VM" /loadcfgfile "%CMDER_ROOT%\config\ConEmu.xml" /cmd cmd /k "%CMDER_ROOT%\vendor\init.bat cd %CD% && %~1"
I've also saved a file named SObatch.bat in C:\batches that contains this:
if not defined myComs set myComs=0 && please %~0
#echo off
ping localhost
echo %userprofile%
pause
Upon double-clicking SObatch.bat a Windows prompt is opened, and the pings are run:
I just narrowed the window to leave out real-world user-names. But the ping functions are being run and the usual responses are returned.
So I guess it still seems that I've broken something.
Create a file called please.cmd and save it to C:\Windows\System32 as administrator. It should then exist as c:\Windows\System32\please.cmd
#echo off
if not defined CMDER_ROOT set "CMDER_ROOT=C:\Cmder"
start %CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.exe /icon "%CMDER_ROOT%\cmder.exe" /title "Homestead VM" /loadcfgfile "%CMDER_ROOT%\config\ConEmu.xml" /cmd cmd /k "%CMDER_ROOT%\vendor\init.bat cd %CD% && %*"
Now when you create a batch files you need to make some changes in the top of each batch file you want. You would need to add the below line to the very top of the script.
"%systemroot%\system32\please.cmd" "%~f0" && goto :eof
You can also from cmd please command to launch it from the cmder shell. Example:
please ping localhost

Opening 2 programs with a batch file, how can i kill a program AFTER i exit the other program myself?

So i'm unfortunately not a coder (yet, i'll be starting learning windows c++ in a couple of months), and i'd like to understand more how batch files work by doing something like this :
Basically, when i start 2 programs (here, Fortnite and a script alongside) with a selfmade batch file, i'd like the script to be killed ONLY when/after i exit Fortnite.
I've tried 2 methods :
http://prntscr.com/kai6iy (start /wait) -
http://prntscr.com/kai68g (:waitForExit)
Is there something i'm doing wrong? the 1st method just doesn't kill the script when i exit Fortnite, and the 2nd one instantly kills the script in a millisecond, way before Fortnite has even started! :/
I don't know anything windows-related right now! Only started objective-c for mac yet.
You did not provide any output so it is hard to guess, but try adding /t and /f to the taskkill command and see if it helps. I was able to make it work with Notepad and Calculator. If the code below still does not work please be sure to post any errors you are getting. We will need more info.
Your code would be:
#echo off
cd C:\Users\odile\Documents\SCRIPTS
start /b fortnitecp.exe
cd "C:\Program Files\Fortnite\FortniteGame\Binaries\Win64"
start /wait FortniteClient-Win64-Shipping.exe
taskkill /IM fortnitecp.exe /T /F
(I also added quotes around the second path since it has spaces)

How to prevent batch window from closing when error occurs?

I'm trying to write batch script to create a folder if it does not already exist.
Following up the online examples, below is my script.
The problem is; first pause works, then probably due to syntax error the window closes even before reaches to the second pause, so I can't really tell which part of my script is wrong.
Could anyone show me how to prevent closing window so that I can see what's on the window?
#echo off
:copy theme images over
:designer
echo copying theme images over...
pause
if not exist "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text"
(
md "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text333"
)
pause
You could put this line at the beginning of the batch file:
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
What this line does is, the first time you run it, it re-launches itself in a subprocess that doesn't exit after it finishes running the batch file.
You need to pass the /K switch to CMD, or just open a Command Window and run the batch from the command line.
Press start and type cmd and press enter, you will launch a command prompt.
Just drag and drop what you need to run (your python script, .exe ...) into the cmd windows, and press enter.
(You might some time to run the cmd as admin: find the cmd in the start menu, right-click on it, choose run as admin).
I recorded the screen (bandicam) for when I couldn't quite read the error message, and then I could replay it; I suppose this is mainly helpful if you already have software on your computer.
using pause at end of batch paused the cmd screen, tanks!
How to prevent batch window from closing when error occurs?
I had the problem when using robocopy. My solution was:
if not %errorlevel% lss 8 pause
For Robocopy every exit code below 8 is a success:
https://ss64.com/nt/robocopy-exit.html

Starting an exe in the same console

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%

Run a batch file in a new window from batch?

I know it seems this has been asked before, but I need a batch to open another batch in a new window. I've tried:
start abc.bat
cmd abc.bat
run abc.bat
and others. They've all opened in the same window or just opened Command Prompt in new window, ignoring my batch. Is there a batch command to open a batch file in a new window?
Is this what your after?
start "New Window" cmd /c test.cmd
It's a little bit strange that start abc.bat doesn't work but I assume this is because you are running this in the middle of another batch. You probably need call:
22:22:38.85 c:\help call
Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters]
Giving you start call abc.bat or call start abc.bat depending on what the exact problem is.
To simply do it is just
start cmd /c "exampleexample.bat"
This could also work with spaces;
start cmd /c "example example.bat"
And directories.
start cmd /c "C:\NAME\Example\Hi there\example example.bat"
I created my universal batch with this and this works flawlessly.
start abc.bat works for me. What is the problem in your case? You could also try start cmd /c abc.bat.
I found something that works:
call "C:\FILEPATH HERE\abc"
Demo:
#echo off
call "C:\Users\USERNAME HERE\Desktop\abc"
This should work <3
Unfortunatly, I know of no such method (I encounter the same thing). However, try killing the old window when you start the batch
abc.bat:
abd.bat
stop
abd.bat:
#echo off
#echo It works!
If you are going to run it in a different command prompt, type start C:\abc.bat or whatever the directory of abc.bat is, or if you want to open it in the same command prompt, type call "C:\abc.bat" again, wherever the directory is. It should work
Either:
call "C:\abc.bat"
or
start C:\abc.bat

Resources