Archives For Microsoft Windows

It’s true. If you’ve earned your MCSA in Windows Server 2016, Windows Server 2012, Cloud Platform or Linux on Azure, then you’re one exam away from earning MCSE: Cloud Platform and Infrastructure. In the past, most MCSA’s were required to pass three exams to obtain an MCSE. That adds up to a lot of time and money. It also looks like this offer will expire by the end of the year. See the “Certification Exams and Prep Resources” area. Leveling up from MCSA to MCSE could be the difference in landing the job you want or being looked over for a more qualified candidate.

So, I read somewhere, using WMIC, I can ‘…name=”product” and version=”0.0.0.0″ call uninstall’ to remove the proper product version. This syntax produced an error for me. So, after reviewing a list of installed product versions and seeing that the likelihood of a match wasn’t likely at all, I decided to just use the version number. It turns out, it works just fine.

WMIC Uninstall Version

WMIC Uninstall Version

So, I didn’t expect an USB external hard drive to appear as a local disk but there it was “E:\ Local Disk”. I wrote a script a few months ago thinking I covered all my bases. However, I wrote it expecting all external drives to appear as a Removable Disk. Note the additional line of my batch file identifies disk using a USB interface. Problem solved!

@echo off
:main
echo "Please enter a valid hostname or type exit to quit"
set /p host="Enter Hostname: "
if %host% == exit goto escape
wmic /node:"%host%" diskdrive where interfacetype='USB' list brief
wmic /node:"%host%" logicaldisk get description, name
pause
goto main
:escape
exit

Our security admins stopped allowing programs to launch outside of the Program Files folder so I was forced to find a solution.

Here’s what I came up with. I hope you find it useful.

@echo off
REM Copy Batch to Computer Needing Software
REM Run Batch as Administrator

REM Copy files, don't display names and overwrite if file already exist at destination
XCOPY "\\server_name\share_folder\software_folder" C:\ /q /y

REM Install Path for 64-BIT OS without display
IF %processor_architecture% == AMD64 (
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files (x86)" /qn
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files (x86)" /qn
)

REM Install Path for 32-BIT OS without display
IF %processor_architecture% == x86 (
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files" /qn
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files" /qn
)

external drive attached == yes || no? Simple enough you might say but I hadn’t tried it before. Growing with confidence from practicing Perl, Python and Ruby in my spare time, I decided I should be able to use WMI, my go to tool when administrating Windows systems.

Here’s what I came up with…

@echo off
:main
echo "Please enter a valid hostname or type exit to quit"
set /p host="Enter Hostname: "
if %host% == exit goto escape
wmic /node:"%host%" logicaldisk get description, name
pause
goto main
:escape
exit