I am having major issues getting a batch file to run correctly on Windows 8.
The below runs fine in Windows 7, however doesn't run in Windows 8. If I remove the /quiet flag I get the installer come up, but it asks me all the installation questions that the transform file is supposed to be answering.
#ECHO off
msiexec /i "\\syd-san01\software$\fortinet\forticlient.msi" TRANSFORMS="\\syd-san01\software$\fortinet\forticlient.mst" /quiet /norestart
pause
#exit
I have tried changing the TRANSFORMS= to TRANSFORM= and /t (no =) however this has made no difference.
Does anyone know of any changes to msiexec in Windows 8 that would stop this file from running correctly?
Thanks
Related
I am currently creating an improvised installer for a cople software packages. To do this I have to install a couple MSI packages first before doing a couple file operations.
To install an MSI package I am using the following command:
start /wait msiexec /i "Myinstaller V2.1.msi" /qb
This command works and installs the package instantly and witout any problems via CMD.
But when I put this command in my batch file and execute it as an administrator, I get the following error:
This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package
What cold be the problem? Using the same command via the console works flawlessly, only the batch file throws the error...
EDIT: I have also tried the /a parameter in order to install it as an administrator and it does not work either. Full command in batch file:
start /wait msiexec /qn /a "Myinstaller V2.1.msi"
EDIT2: I just realized that it only does not work when I start the batch file with Right click > Run as administrator
When I open a console with administrative rights and start my batch file it works for some reason...
Is there a way to make it work with the Right click > Run as administrator method?
SOLUTION: Thanks to RGuggisberg's answer I now know that the directory changes once the file is executed as an administrator. With a small change the installer gets fired up as an admin and works perfectly starting the installer from a relative path in the same directory:
#echo off
pushd %~dp0
start /wait msiexec /i "Myinstaller V2.1.msi" /qb
pause
I've now also implemented a feature to detect wether or not the installation fails or not:
#echo off
pushd %~dp0
start /wait msiexec /i "Myinstaller V2.1.msi" /qb
if %ERRORLEVEL% EQU 0 echo SUCCESSFULL
if NOT %ERRORLEVEL% EQU 0 echo MyProgram installation FAILED
pause
The current directory changes when you run as administrator. If you want to prove that to yourself, see this post
Difference between "%~dp0" and ".\"?
Include the full path to your filename and it will work.
I am using batch Script for silent Installation to update the locked and in use files.Using silent installation reboots my system automatically after the update.But I wanna setup a custom reboot message box , So I used the REBOOT=ReallySuppress attribute. And I used a message box to popup the custom reboot message. This helps me avoid the auto-reboot of the system but it is not updating the files even after performing a manual reboot.
Here is the script that I am using.
#echo off
title Installing Updates
msiexec /i "C:\Users\tparvathaneni\Documents\Visual Studio 2015\Projects\SetupProject1\SetupProject1\bin\Debug\SetupProject1.msi" /qn /REBOOT=ReallySuppress
echo updates installed
echo msgbox "Restart your system to complete the installation." > "%temp%\popup.vbs"
wscript.exe "%temp%\popup.vbs"
pause >NUL
shutdown.exe /r /t 000
Can someone give me a solution to get the files updated with manual reboot.
did you try instead of /REBOOT=ReallySuppress the /norestart option?
Please also make a log file in the install cammand via /l option. Then read the log if really the installer reboots the computer.
#echo off
start /wait wusa.exe %~dp0Win7AndW2K8R2-KB3134760-x64.msu /quiet /norestart
I have a .bat file with the above code. The file is located in \wds\e$\Shared\DeploymentBuild\Applications\Microsoft WMF 5.0.
The problem is, when I run it, it brings up the "Windows Update Standalone Installer" window and it won't do a silent install.
I have a copy of the same .bat file in my local computer, and it works fine without any issues. Please help me figure this out.
Thank you,
Tony
Start by changing your batch file accordingly:
#echo off
if not exist "%~dp0Win7AndW2K8R2-KB3134760-x64.msu" (
Echo= The MSU file isn't here!
Timeout -1 >Nul
Exit/B)
wusa.exe "%~dp0Win7AndW2K8R2-KB3134760-x64.msu" /quiet /norestart
KB3114409 KB2825678 windows update patch files you may know that has caused many user to only be able to launch outlook in safe mode. that means i can not find anybody in outlook, anyway it is no good patch to me.
so i made batch file for our staff that is for uninstalling windows patch about KB3114409 KB2825678. it seems to be looking those file and uninstall. but if i have a look in installed update console, there is still remain those two.
i execute this batch file in administrator mode as well, but still same in.
#echo off
Wusa /KB:3114409 /Uninstall
Wusa /KB:2825678 /Uninstall
exit
i made it like that, but i still have those patches...
i use win7 64bit and using user mode, not administrator mode.
please any idea..?
Not sure if you really have everything on one line or if your post just turned out that way. This is what I use:
#echo off
start "" /b /wait wusa.exe /uninstall /kb:3114409 /quiet /norestart
start "" /b /wait wusa.exe /uninstall /kb:2825678 /quiet /norestart
To put all commands on one line you would need to separate them with &
but that makes it a bit harder to read. Also see WUSA /?
Its better to use MSIEXEC to remove this patch since its an "Office patch" and not for Windows.
Tutorial and script approach described at: http://blog.jocha.se/tech/uninstall-outlook-kb3114409
I have a setup file (MSI) that can be run and install properly on a win 7 64bit system. My client wants a silent install. For this, I created a bat file (see below) and passed /qn parameter which works on a Windows XP system but gives INVALID SWITCH error on Win7 64 bit. Is there any solution to this?
start C:\Setup1\Debug\Setup1.msi /qn
pause
REN "C:\WINDOWS\system32\FHPropertyVideoScreenSaver.exe" "FHPropertyVideoScreenSaver.scr"
If you type msiexec /? at a cmd prompt you can see the switch you need is
/quiet - Quiet mode, no user interaction
or you can use
/q with other options to specify how much interaction there is.
The switch is correct for Windows 7 too, maybe you have a permissions problems. Check this thread: msi file isn't installed silently using /qn