Powershell Command Find the error (s) echo off cls systeminfo | find /i \"System
ID: 3750908 • Letter: P
Question
Powershell Command
Find the error (s)
echo off
cls
systeminfo | find /i "System Type" | find /i "X86-based PC"
if %errorlevel% == 0 set spth="C:Program FilesShoreline CommunicationsShoreWare ClientShoretel.exe"
Echo Checking System Type (x86 vs x64)
systeminfo | find /i "System Type" | find /i "X64-based PC"
if %errorlevel% == 0 set spth="C:Program Files (x86)Shoreline CommunicationsShoreWare ClientShoretel.exe"
Echo Checking if Communicator is already installed.....
if exist %spth% goto end1
if NOT exist %spth% goto install
:install
echo Installing Shoretel Communicator
\cupe-fs-1ppsShortelConnectinstall-winGPOsetup.exe /S /v"/qn REBOOT=reallysuppress"
echo Installation Finished
exit
:end1
echo Shoretel Communicator is already installed.
ping 127.0.0.1 -n 5 > nul
exit
Explanation / Answer
Hi,
I am giving the correct implementation below followed by the list of errors:
----------------------------------------------------------------------------------------------------------------------------
echo off
cls
systeminfo | find /i "System Type" | find /i "X86-based PC"
if ($LASTEXITCODE = 0)
{ set spth="C:Program FilesShoreline CommunicationsShoreWare ClientShoretel.exe"}
Echo "Checking System Type (x86 vs x64)"
systeminfo | find /i "System Type" | find /i "X64-based PC"
if ($LASTEXITCODE = 0) {set spth="C:Program Files (x86)Shoreline CommunicationsShoreWare ClientShoretel.exe"}
Echo "Checking if Communicator is already installed....."
if (Test-Path %spth%){
echo "Installing Shoretel Communicator"
\cupe-fs-1ppsShortelConnectinstall-winGPOsetup.exe /S /v"/qn REBOOT=reallysuppress"
echo "Installation Finished"
exit
}
if (!(Test-Path %spth%)) {
echo "Shoretel Communicator is already installed."
ping 127.0.0.1 -n 5 > ne
exit
}
----------------------------------------------------------------------------------------------------------------------------------
Now i will list down the errors in the program.
Hope this helps!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.