Batch file pack installation programs with partially unknown name - batch-file

I want to create a batch file that will first send me to the download page, and then run the install of multiple programs sequentially. I know I can use this kind of code to start setups with accurately known names:
start https://www.7-zip.org/download.html
timeout /t 5
start DownloadPage1
pause
start 7z2106-x64.exe
timeout /5
start program1setup.exe
(BAT will be in the download folder, where setups will go; setups will be downloaded manually)
But it'll only work with exact file names, I want it to work with any version of 7z as an example, a file that starts with "7z" and ends with "x64" with unknown middle symbols, as a version.
start 7z?x64.exe
I'm open to any suggestion of improving this basic code, cuz I'm an even more basic "programmer".
Thanks.

Related

Appcrash Kernelbase.dll error when attempting to run SSIS package via DTExec.exe

I recently came across an issue while attempting to run a master parent SSIS package which calls several children packages. I haven't found a post with this exact issue, so I thought I'd share how I believe to have solved the issue. This is the error that would occur when attempting to run the package:
So after researching the issue, I believe what the cause was, was that I was attempting to run the SSIS package on a 64 bit server in one of our lower environments, and a few of the children packages called by the master parent package would read from MS Access database files, which were 32 bits. So in order to resolve this issue, I found this site very helpful:
SSIS Executing Packages
...from where I realized that I needed to include an "/x86" switch in the .bat file which was calling my Master package to run, like so:
REM Runs DTSX package via the command line
pushd D:\SFAS\SSIS\SESDatamart\bin
"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" **/x86** /f "D:\SFAS\SSIS\SESDatamart\packages\MASTER DATAMART.dtsx" /set "\package.variables[User::PriorYears].Properties[Value]";3
popd
REM Capture error code and send to UC4
exit /b %errorlevel%
In any case, I wanted to post this somewhere, so that it might help someone who might be experiencing this issue.
Thanks!
I wanted to provide an update to this error. It turns out that it wasn't only a matter of adding the "X86" switch to the bat file, but that the Dev and Int servers were actually low on memory and processors. We ended up having to add additional of both and it seems to have resolved the issue, thankfully, by providing additional resources and processing power.

Trying to set up a deployment package for silent uninstall of Notepad++ and installation of a new version

All of the below on Windows 7 Machines and regarding Notepad++ installation / uninstallation:
Uninstaller
When I try to uninstall using the command
if exist "C:\Program Files (x86)\Notepad++\uninstall.exe" "C:\Program Files (x86)\Notepad++\uninstall.exe" /S
there are some files left in the Notepad++ file afterward. Notepad++'s uninstaller, when run manually, prompts halfway through the uninstall asking "Do you want to keep your custom settings" and I'm thinking that the command may be choosing to answer this "Yes" by default. I'm wondering if there's an easy way to have it choose "No" here instead. If not, I can probably just delete the folder.
Installer
I'm running the installation using the 32 bit default .exe file from Notepad++ in a deployment package compiled in Lansweeper. What I'm noticing is that presently, the package executed the CMD uninstall command, but stops short of installing the new version. For reference, I've been using an installed 7.3.2 and the installer for 7.3.3 to test, so that it should uninstall the 7.3.2 and install 7.3.3 by the end of the package.
I'm wondering if the fact that there are a number of options in the Notepad++ installer could be the culprit here. If it is better to install via command line or to include some sort of configuration file I'm fine with either option, just not especially well-versed in doing them.
Notepad++ Installer requests the following during installation:
Select a language - should choose English
Choose Components - want to be able to customize selection of localization / auto complete / themes / context menu / plugins / auto update according to our requirements
Choose Components - Don't use Appdata, Allow Plugins to be loaded from Appdata, and Create Shortcut on Desktop should all remain unchecked
Run Notepad ++ - should be unchecked (checked by default)
All the other components that I can see are straightforward Next / I Agree buttons.
I'm hoping someone may be able to make helpful suggestions here as I've not had any experience with configuring silent installs with specific parameters. Notepad++ doesn't seem to have its own MSI and I won't use a third party one so some sort of batch or configuration file or flagging options in cmd if possible are the preferable options.
Please let me know if there's any additional information I can provide that may be helpful.
Thank you in advance.
If you just need to update to the latest version. It is quite simple. Run the newest installer again and it will automatically update older versions.
See
Silent Install Notepad++
I'm using the command:
start /wait npp.7.2.Installer.x64.exe /S
Didn't show any interface during silent installation.
Notepad kicks a secondary process that doesn't finish until success is evaluated.
try:
"%ProgramFiles(x86)%\Notepad++\uninstall.exe" /S
timeout 5

TortoiseSVN batch file output info

I am trying to do the equivalent of the following Linux command with a Windows batch file and TortoiseSVN.
svn info > info.txt
I have tried the following with no luck:
start /wait "" "c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:info >> %CD%\info.txt
I am running Windows with TortoiseSVN v1.6.16 so I don't have access to the command line tools.
Note: We were encountering issues with the newer version of TortoiseSVN so we went back to 1.6 until issues are resolved with a newer version and the company upgrades the server to that version.
Your construction didn't work, doesn't work and will never work due to zero-bits of trueness:
start (with and without /wait) have sense in bat-file only if you have more than one bat-process starting from this bat (compare with call), for called GUI it doesn't differ from direct using program-name
TortoiseProc is GUI-app after all, it emits nothing to stdout
Info was and is unknown command for TortoiseProc, thus you'll get only GUI-window "About"
:about Shows the about dialog. This is also shown if no command is
given
In addition to correct suggestion "Update to at least 1.8 on client and have CLI-tools" you can consider following solutions:
Install from unrelated to TortoiseSVN sources pure CLI SVN-client (also 1.6.* - from WanDisco will be good choice) at the same as TSVN or another location (I done it at the times of 1.6)
Study and use subwcrev (it was part of TortoiseSVN even in 1.6, AFAICR) and emulate some part of svn info in subwcrev's template-file with correct keywords

Run .bat as a Windows Service

I'm here again with another case that is getting me out my mind.
So, this is happening, I'm trying to run an executable java class(.jar) as a Windows Service, and all my attempts failed so far. To make it a little easier, I turned my jar into a batch file, wich only executes the jar in background, here is the code:
start "" javaw -jar C:\LocalService.jar
The batch works fine. However I have tried to install this batch as a service by using the next line in cmd:
sc create "LocalService" binPath= "C:\LocalService.bat"
The Service installs correctly, but as soon as I try to start it, it pops up an error (The code error is 1053, says something about the service did not start correctly)
Also, I have try with a software called NSSM (non-sucking service manager) It installs fine too, but the service does not start either.
Do you guys know what am I missing?
By the way, I'm doing all this on Windows 7 Professional.
Thanks!
thanks for your comments
Both tools didnt work for me, sadly. However I was able to do it with a software called Java Service Wrapper. This is not a free software, so I needed to buy a license to get it to work.
The steps were simple:
1.-Create a folder with the name of the service, then inside add 4 folders: lib,bin,logs,conf
2.-On the lib folder you have to copy your jar and also the wrapper.jar and wrapper.dll (these last two are in the zip you download from the website)
3.-Copy 4 files to the bin folder: InstallApp-NT.bat.in, App.bat.in, UnintstallApp-NT.bat.in and wrapper.exe (this last one is the one that defines your license, if you can get a file wrapper.exe from somebody else who had paid a license it will work fine. These file also came in the zip from the website) Remove the .in from the batch files
4.-The most tricky step is this: You have to copy from the wrapper's folder called conf a file called wrapper.conf.in Remove the .in extension and edit it with a tex editor. The most important lines you have to edit are:
wrapper.java.command=C:\Program Files (x86)\Java\jre7\bin\java //Specify JRE Path. Will work with eviroment variable
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperJarApp //Choosing this class means your are using a .jar file to execute when the service starts
wrapper.java.classpath.1=C:\LocalService\lib\wrapper.jar //This one is constant.
wrapper.java.classpath.2=C:\LocalService\lib\LocalService.jar //This is the path to your executable jar
wrapper.java.library.path.1=C:\LocalService\lib //Path to your own lib folder (the you created at the begining)
wrapper.app.parameter.1=C:\LocalService\lib\LocalService.jar // again the path to your jar
Then just execute the InstallApp-NT.bat and start the service and your are done
It worked to me with absolute paths, however according to documentation it will work fine with relative path too.
This is how I solved my problem and I hope someone with the same issue will find this helpful
See you next time!

Getiing error message 'Failed Installing JBAS50SVC' whle running service.bat file in Windows 7

I need to run Jboss 7 as service.
Followed these steps :-
Copied my Jboss to C:\Program Files <86>
Downloaded Jboss-native-2.0.10-windows-x64-ssl and copied the contenst of bin catalog to %JBOSS_HOME%/bin
Changes done on service.bat as per link instructions
https://community.jboss.org/message/724488
Changed my dir location to my Jboss bin
and given command service.bat install
C:\Program Files \jboss7>bin>service.bat install
Failed installing JBAS50SVC
Access is Denied.
Service JBoss Application Server 7.1.1 installed.
I'm not able to rectify this problem .
It appears to be windows access issue.
Try the following:
Does the windows ID you are using have Administrator privileges? If no, get a Admin ID else if Yes, proceed to step 2.
Try to do the same but in some other drive (not c: )
UPDATE #1 : OP says he can not see the output of service.bat file
Follow the following steps
Open start menu
Search for "cmd"
Right click "cmd" and run as Administrator
type in following command
cd C:\Program Files \jboss7\bin
Type service.bat and observe the output
On a 2008 Windows Server this occurs because you're not running the command line as an administrator. Those of us who have spent considerable amounts of time on 2003 server, and others before that, keep forgetting that your logged in ADMIN level account does NOT get passed to the command line automatically like with previous versions of Windows.
With any additional errors, past this one, I would keep going back to the service.bat file and looking at the path statements, throughout that file, to ensure that they are all correct to reach what is correct for your installation.
Also, don't forget to create a log folder under standalone (unless you're doing a domain install). Failure to do that will also cause issues as well.
yoda

Resources