I am trying to write a Script that will install our remote app applications automatically. Here is what I have so far:
REM Install Remote Icons
#Echo On
pushd "\\Servername.com\it\RDP\Installers\"
start msiexec /i "\\Servername.com\it\RDP\Installers\ExercisePro.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Excel.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Word.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Outlook.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts EHR.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts PM.msi" /qn
start msiexec /i "\\Servername.com\it\RDP\Installers\MModal Allscripts EHR.msi" /qn
popd
mkdir C:\Users\%USERNAME%\Icons
copy C:\Users\%USERNAME%\%APPDATA%\Local\Microsoft\Installer C:\Icons
pushd "\\Servername.com\M Modal\Fluency.Direct.9.1.65.7.6.4.v7\fd.client\install_silent.bat"
popd
copy \\Servername.com\Private IT\PC_Shortcuts \\%COMPUTERNAME%\%USERNAME%\Public\Desktop
pause
So far the script is not working as I intended it. I want it to install the applications then I want it to make a directory called C:\Icons and copy the app data over to that folder so I can delete the appdata entries that it makes and those entries take the user profile longer to login. Also I have a folder on the server that I want to copy to the local desktop that has all of the internet shortcuts we use. This is also not working correctly :(
This should work for you.
Also do you really need all the pushd and popd if you are providing the full location of the sources you are copying. If you are executing a file, and calling it by it's full Universal Naming Convention (i.e. C:\Folder\Test.txt) then you don't need to change your current directory to C:\Folder, you can run that file from anywhere within the computers file system, as you are providing the full file location.
If you want to run the file by only providing the filename, or a partial address to the file, you would then need to change to the directory the file is residing in, or provide the location to the director from where you are located. (i.e. if you are in C:\Folder1 and the file resides in C:\Folder1\Folder2\Folder3\File.txt you would need to use the following address .\Folder2\Folder3\File.txt as you are already located in C:\Folder1 and the .\ acts as a placeholder\variable for the current directory you are sitting in).
REM Install Remote Icons
#Echo On
msiexec /i "\\Servername.com\it\RDP\Installers\ExercisePro.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Excel.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Word.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Outlook.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts EHR.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\Allscripts PM.msi" /qn /norestart
msiexec /i "\\Servername.com\it\RDP\Installers\MModal Allscripts EHR.msi" /qn /norestart
Call "\\Servername.com\M Modal\Fluency.Direct.9.1.65.7.6.4.v7\fd.client\install_silent.bat"
mkdir C:\Users\%USERNAME%\Icons
copy C:\Users\%USERNAME%\%APPDATA%\Local\Microsoft\Installer\*.* C:\Users\%USERNAME%\Icons /Y
copy \\Servername.com\Private IT\PC_Shortcuts\*.* \\%COMPUTERNAME%\%USERNAME%\Public\Desktop /Y
pause
NOTE: I have added in the /norestart to ensure that your device doesn't restart after any of the installations, which would then in turn kill the installation script.
You can use powershell remoting for this tasks. Check invoke-command with the -ComputerName parameter for remote actions. With Powershell version 5 Copy-Item supports FromSession ToSession parameters to copy files remotely. You can run msiexec via Start-Process.
Related
I'm trying to install a .msi package (adobe reader) through Microsoft msiexec
I wan't to do a silent install
my Code Looks like this:
msiexec /a "%~dp0..\adobe\setup"
problem:
whenever I use double dot (..) in msiexec command path I get an error
msiexec /a "adobe\setup"
works fine.
so, I even couldn't find a single example using similar path in msiexec command.
any help would be appreciated.
without msiexec none /S /qn or /silent works
So I'm out of ideas.
thanks in advance.
I think you have 2 options, either:
cd..
msiexec adobe\setup.msi
Or
set parent=%~dp0
msiexec %parent%adobe\setup.msi
I want to install "foo.msi" from cmd command line. I run:
msiexec.exe /qn /i .\foo.msi
It returns almost instantaneously and foo.msi does not get installed. I'm not sure what I'm doing wrong.
To root out the causes of error, I ran:
msiexec.exe /qn /i .\doesNotExist.msi
And got the thing. It returns immediately. No complaints about not being able to find the .msi or anything.
Does anyone know the proper way to use msiexec.exe to install an msi from windows cmd command line?
msiexec runs asynchronously. If you want to wait for it to complete its work, use:
start /wait msiexec /qn /i .\foo.msi
In this case, the first step to run your command with the logs option as below:
msiexec -i "foo.msi" /qn /L* "d:\logs\log.log"
Check the logs for errors. When I faced this, the issue was missing property values. That can be pass like below:
msiexec.exe /i "foo.msi" MYPROP1="myValue1" MYPROP3="myValue2"
I have a .vbs file called test.vbs. And this is running test.bat file silently.
In test.bat file,
CD.>"C:\folder\empty.srt"
dir /b /s "C:\folder" | findstr /m /i "\.srt$" > C:\old.txt
CD.>C:\new.txt
.
.
echo for /f "delims=" %%a in ('findstr /G:%new% /I /L /B /V %old%') do (#echo %%~nxa >> C:\added.txt)
.
.
CD.>C:\added.txt
del "C:\folder\empty.srt"
When I run test.vbs manually .bat file works fine.
But when I run test.vbs from Windows' Scheduled Tasks (command is: C:\test.vbs (tried wscript test.vbs) )
Only creates empty.srt and removes empty.srt. The other commands are not working.
I don't understand why (maybe administrator priviliges (Account is administrator too).
I thought running as administrator would solve the problem. Or is there another way to do this? How can I do that?
edit: Also working when I run this command from CMD --> wscript C:\test.vbs
Also its working fine on Windows 8
I also ran into this issue a while back, as well as have answered a variation of this issue before.
If it's a 64 bit operating system, then you need to open the script via "C:\windows\syswow64\cscript.exe your_vbs_code.vbs" if not, just use "C:\windows\system32\cscript.exe".
I create a script to auto install all my dev stack on Windows.
I have a problem with Node.js
What's the command line to install node-v0.10.23-x64.msi in C:\Tools silently?
Thanks.
I found it.
This is the correct way to install Node.js on Windows silently in a custom directory.
msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet
msiexec.exe /i node-v0.10.23-x64.msi /qn
/i means normal install
/qn means no UI
I do not known how to set the destination, you can read documentation here, and check if msi supports it:
http://www.advancedinstaller.com/user-guide/msiexec.html
This will do the exact installation as doing it manual from the UI
msiexec /i node-v6.11.2-x64.msi TARGETDIR="C:\Program Files\nodejs\" ADDLOCAL="NodePerfCtrSupport,NodeEtwSupport,DocumentationShortcuts,EnvironmentPathNode,EnvironmentPathNpmModules,npm,NodeRuntime,EnvironmentPath" /qn
To expand a little on foozar's answer, which works.
msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet
Note that /quiet may be better replaced with /passive:
Passive shows the status bar, and more importantly, prompts the user for the admin password if needed.
Quiet mode will just fail if the installer doesn't have privileges.
How do I install to a non default web site with a silent MSIEXEC installation?
Given the lack of information in your question, all I can say is something like this:
msiexec /i YOURPACKAGE.msi /qn
If you need to pass parameters, you can define them on the commandline:
msiexec /i YOURPACKAGE.msi /qn THISWEBSITE=http://example.com