batch script to check and install dotnet4.0
Hi,
I have to make a .cmd or .bat script to check whether dotnet4.0 is installed or not. If its not installed then Install other wise exit out...
I need help in writing the .bat script. Here I did as below. but didn't worked.. plz let me know bcoz tomorrow it the date to submit it.....
::Check for DotNet 4.0 Install
Start /B /I /WAIT REG QUERY HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\1033
IF %ErrorLevel% EQU 0 (
@ECHO %DATE% - %TIME% : DotNet4.0 already installed
Goto :SkipDotNet
)
::Install DotNet 4.0 Install
Start /B /I /WAIT dotNetFx40_Client_x86_x64.exe /q /norestart
:SkipDotNet
I have to make a .cmd or .bat script to check whether dotnet4.0 is installed or not. If its not installed then Install other wise exit out...
I need help in writing the .bat script. Here I did as below. but didn't worked.. plz let me know bcoz tomorrow it the date to submit it.....
::Check for DotNet 4.0 Install
Start /B /I /WAIT REG QUERY HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\1033
IF %ErrorLevel% EQU 0 (
@ECHO %DATE% - %TIME% : DotNet4.0 already installed
Goto :SkipDotNet
)
::Install DotNet 4.0 Install
Start /B /I /WAIT dotNetFx40_Client_x86_x64.exe /q /norestart
:SkipDotNet
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
nolme
9 years ago
Hi,
sorry for necro-posting but I had the same problem. Here's the solution :
setlocal enabledelayedexpansion
set g_strInternalOutputFullFilename=%TEMP%\Output.log
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" /s|FIND "v4" > "!g_strInternalOutputFullFilename!"
IF %ErrorLevel% EQU 0 (
echo DotNet4.0 already installed
Goto :SkipDotNet
) else (
echo .NET not installed
)
::Install DotNet 4.0 Install
Start /B /I /WAIT dotNetFx40_Client_x86_x64.exe /q /norestart
:SkipDotNet
sorry for necro-posting but I had the same problem. Here's the solution :
setlocal enabledelayedexpansion
set g_strInternalOutputFullFilename=%TEMP%\Output.log
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" /s|FIND "v4" > "!g_strInternalOutputFullFilename!"
IF %ErrorLevel% EQU 0 (
echo DotNet4.0 already installed
Goto :SkipDotNet
) else (
echo .NET not installed
)
::Install DotNet 4.0 Install
Start /B /I /WAIT dotNetFx40_Client_x86_x64.exe /q /norestart
:SkipDotNet
Posted by:
EdT
9 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.