Home > Net >  Want to run a .bat script to install multiple programs on different machines
Want to run a .bat script to install multiple programs on different machines

Time:04-04

Hey guys I need some help, is there a way to create a .bat script that can install multiple applications with out having to specify the user.

For example I have this:

"C:\Users\User\Downloads\Setup\ChromeSetup.exe" /S /norestart "C:\Users\User\Downloads\Setup\readerdc64_en_xa_crd_install.exe" /S /norestart "C:\Users\User\Downloads\Setup\SlackSetup.exe" /S /norestart "C:\Users\User\Downloads\Setup\TeamViewer_Setup_x64.exe" /S /norestart

Which works for the specified user but I have multiple machines I want to run this on locally and its just kind of a pain to have to go back in and change the user for each install. Is there a way to make this install to any user without having to specifically refer to the user?

Also I cannot use Ninite or other programs due to some of our other software not being available for those tools.

CodePudding user response:

The %USERNAME% environment variable returns the current user, so you can just replace each Users\User with Users\%USERNAME%.

CodePudding user response:

Have a look at psexec by Sysinternals or Advanced Run Tool or NirCmd by Nirsoft. You'd have to make your script and it's dependencies available via network so you can give the command to run via UNC path, like here.

  • Related