BrowseForfolder command not working - windows

;!#Install#!UTF-8!
BrowseForfolder="Yes"
RunProgram="Patch.bat"
DeleteTempFiles="No"
;!#InstallEnd#!
the above code exist in my config.txt file .BrowseForfolder command is not working when i try to run my exe file.(i means the window dialog not appearing to select the path.). directly it is executing my 'Patch.bat' script. Kindly help me on this regard.

Actually i used 7zS.sfx for self extracting.but this 7z sfx won't conatin all the properties which i mentioned in the program (i.e BrowseForfolder,DeleteTempFiles).so i used the modeified version of 7z sfx.which is 7zsd.sfx it solved the issue.

Related

Running a batch file through command prompt - system cannot find the path specified

I am trying to uninstall Oracle on this Windows 7 (64 bit) machine by downloading a standalone tool from Oracle, I need to run a batch file that is supposed to uninstall but I am unable to run it.
I tried to open command prompt as administrator and I am trying to run this as below:
As you can clearly see from the screenshot, I am doing a "dir" on the directory and can clearly see the file right there. Not sure what's going on here.
I also tried to run the batch file by double clicking from Windows Explorer and a terminal window opens and closes quickly but the batch file is not doing what it is supposed to do (it is clearly not executing from Windows Explorer).
Can anyone help me with this?
As theB pointed out above in a comment, this worked for me:
Open the bat file in notepad. I'll bet it starts with #echo off, and
that the error is actually coming from inside the batch file. The
error if the batch file itself wasn't found is 'X' is not recognized
as an internal or external command, operable program or batch file
'Run as Administrator' changes the current directory. See my answer here
Difference between "%~dp0" and ".\"?

Using CMD to open an .exe file, from the same directory?

Im trying to make this launcher for my game.
But I can't seem to find anywhere, how to open a file. Without specifying the location.
Like I want it to run a file, from the same folder as the .cmd file is in. (The one I created).
Been searching for ages, without finding out how.
Reasoning: The user is able to change where the game is going to be installed. So I cant specify a location..
Simply open Command Prompt. Then Drag and Drop your .exe file to the console. (This will copy the location of the .exe file to the console) Then just press "Enter". Then your .exe file should be running.
References http://www.howtogeek.com/209694/running-an-.exe-file-via-command-prompt/
Hope it helps
The argument %0 of a batch file references the name of that batch file. So to run an exe located in the same folder where your batch file is, use:
%~dp0program.exe
The ~dp expands the argument %0 to a full qualified path name - including a trailing \ that's why there is no \ between %~dp0 and program.exe
Details about expanding variables can be found by typing help for on the commandline
Turned out, it was just me being foolish.
Forgot that I could just type in the name of the file.
Instead of doing something big out of it.
Thanks #ByteHamster for refreshing my memory :)
"Quote" ByteHamster: If you are in the same folder, just type in the name of the exe file.

copy exe file while it's running?

This following code in my bat file copy's the bat file while it's running into a correct directory in windows 7 but when I convert it to a exe script it no longer works.
Can any one suggest a alternative ? Or any suggestions to why?
if not exist "%programfiles%\toolset\" (
md "%programfiles%\toolset\"
copy "%~f0" "%programfiles%\toolset\"
)
can any one else help I'm pretty sure it's not my converter tool I use as I have tried all the ones listed below but I think the script needs editing for it to function as exe application?
You can try the following nice tool
http://www.battoexeconverter.com/
since you are accessing programfiles you need to be admin
To do this run the cmd in admin mode and try to execute in command line
Download this tool. It works well.
Bat2Exe
You can add administrator manifest to run as administrator when opening the exe file.
I am a batch programmer just like you.
Personally I use this tool;
http://www.f2ko.de/programs.php?lang=en&pid=ob2e
Nice tool, only requires a download, used it multiple times, never dissappointed me, and it is very legit, have no doubts about it!
Pringles

Why does 7zip Ignore my InstallPath when making a SFX installer?

Currently, I am making a SFX with 7zip using the following config:
;!#Install#!UTF-8!
InstallPath="C:\\test"
GUIMode="2"
RunProgram="7z465.exe"
;!#InstallEnd#!
I then package 7z465.exe into Setup.7z, and then call the following line in a batch file:
copy /b "C:\Program Files\7-Zip\7zSD.sfx" + config.txt + ".\Release\Setup.7z" .\Release\Setup.exe
When I run the resulting Setup.exe, It extracts fine and launches the 7z465.exe as well, but it is still extracting to some 7zip temp folder for the current user and not C:\test!
Running as administrator seems to have no effect either.
Anyone have any idea why this is happening?
Use modified 7zsd.sfx from http://7zsfx.solta.ru. InstallPath only works with the modified package.
I never found out why this was happening, and after hours of struggling with it, I switched to WinRAR. Granted, its got some quirks of its own, but I was at least able to figure those out and get it running for my needs.
Would recommend WinRAR over 7z for SFX stuff.

Avoid blinking when launching a .cmd file

I was downgraded from Vista to XP for reasons that are not relevant.
I found very useful the snipping tool which is not available in XP so I decided to create my own.
alt text http://img81.imageshack.us/img81/8851/snip251609121640.png
It works just fine so I put it int .cmd file for easy launching ( I didn't feel like creating the .jar file )
My only problem now is the command prompt screen pops up and disappear giving an unpleasant effect.
This is it:
echo off
start javaw -classpath lib\myutil.jar;classes recortes.Main
Is there a way the command just run without blinking ? ( other than creating the .jar file? )
EDIT
I have followed the advice of Jeffrey. I had a shorcut to the .cmd file, now the shortcut it self has the following:
"C:\Archivos de programa\Java\jre6\bin\javaw.exe" -classpath lib\myutil.jar;classes -Djava.util.logging.config.file=logging.properties recortes.Main
Start in:
C:\Users\oreyes\recortes
And works just fine!
Thanks
Create a shortcut (.lnk) file which contains the path to the executable with arguments. See KB244677 for information on how to do this from a script.

Resources