SCRLPB
asked on
Check EXE version in a batch file and if need be replace with another
I want to replace a file tswpfwrp.exe in Windows\System32 folder if it is an older version then the one I am replacing it with, otherwise, I don't want the batch file to run.
Below is an example of what I am trying to achieve, however, I don't know much about batchfile creation so the below example is not functional. Please help me create an effective batch file:
IF EXIST "C:\WINDOWS\system32\tswpf wrp.exe VER 3.0.6920.1201" goto lable1
IF NOT EXIST "C:\WINDOWS\system32\tswpf wrp.exe VER 3.0.6920.1201" goto lable2
:LABLE1
echo Current Version exists
pause
goto exit
:LABLE2
copy \\ourdomain\dfs\SoftwareIn stall\dotN etFramewor k\tswpfwrp >> c:\C:\WINDOWS\system32\
echo INSTALLING DOTNET FRAMEWORK UPDATE.
Pause
goto exit
:EXIT
Below is an example of what I am trying to achieve, however, I don't know much about batchfile creation so the below example is not functional. Please help me create an effective batch file:
IF EXIST "C:\WINDOWS\system32\tswpf
IF NOT EXIST "C:\WINDOWS\system32\tswpf
:LABLE1
echo Current Version exists
pause
goto exit
:LABLE2
copy \\ourdomain\dfs\SoftwareIn
echo INSTALLING DOTNET FRAMEWORK UPDATE.
Pause
goto exit
:EXIT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Set objFSO = CreateObject("Scripting.Fi
Wscript.Echo objFSO.GetFileVersion("c:\