IFW Batch Script with Win 10

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.

IFW Batch Script with Win 10

Postby TimHood » Sun Aug 16, 2015 8:12 am

The latest upgrade to Win 10 causes IFW batch scripts to fail. A simple, but not necessarily elegant, fix is to extend the current script statements in the Profile.cmd file.

Currently the script contains:

@echo off & cls & setlocal enableextensions
ver | find "Version 5." >nul
set VerCheck1=%ErrorLevel%
ver | find "Version 6." >nul
set VerCheck2=%ErrorLevel%
set VerCheck=%VerCheck1%%VerCheck2%
if "%VerCheck%"=="11" (echo These scripts run only on Windows 2000 or later.) & (MsgBox "These scripts run only on Windows 2000 or later." "Image for Windows Scripts" 4 1) & (goto :EOF)

Add a check for (the absence!) of Win 10 by changing the same script to:

@echo off & cls & setlocal enableextensions
ver | find "Version 5." >nul
set VerCheck1=%ErrorLevel%
ver | find "Version 6." >nul
set VerCheck2=%ErrorLevel%
ver | find "Version 10." >nul
set VerCheck3=%ErrorLevel%
set VerCheck=%VerCheck1%%VerCheck2%%VerCheck3%
if "%VerCheck%"=="111" (echo These scripts run only on Windows 2000 or later.) & (MsgBox "These scripts run only on Windows 2000 or later." "Image for Windows Scripts" 4 1) & (goto :EOF)

Now if all three checks fail the message for Win 2000 or later still applies and the batch process will abort. However the important part is that the existing backup script approach will succeed if all your copies of the Profile.cmd are modified accordingly.
TimHood
 
Posts: 1
Joined: Sun Aug 16, 2015 7:00 am

Re: IFW Batch Script with Win 10

Postby TeraByte Support » Sun Aug 16, 2015 6:52 pm

thanks, but they are already updated...

"TimHood" wrote in message news:10096@public.scripting...

The latest upgrade to Win 10 causes IFW batch scripts to fail. A simple, but
not necessarily elegant, fix is to extend the current script statements in
the Profile.cmd file.

Currently the script contains:

@echo off & cls & setlocal enableextensions
ver | find "Version 5." >nul
set VerCheck1=%ErrorLevel%
ver | find "Version 6." >nul
set VerCheck2=%ErrorLevel%
set VerCheck=%VerCheck1%%VerCheck2%
if "%VerCheck%"=="11" (echo These scripts run only on Windows 2000 or
later.) & (MsgBox "These scripts run only on Windows 2000 or later." "Image
for Windows Scripts" 4 1) & (goto :EOF)

Add a check for (the absence!) of Win 10 by changing the same script to:

@echo off & cls & setlocal enableextensions
ver | find "Version 5." >nul
set VerCheck1=%ErrorLevel%
ver | find "Version 6." >nul
set VerCheck2=%ErrorLevel%
ver | find "Version 10." >nul
set VerCheck3=%ErrorLevel%
set VerCheck=%VerCheck1%%VerCheck2%%VerCheck3%
if "%VerCheck%"=="111" (echo These scripts run only on Windows 2000 or
later.) & (MsgBox "These scripts run only on Windows 2000 or later." "Image
for Windows Scripts" 4 1) & (goto :EOF)

Now if all three checks fail the message for Win 2000 or later still applies
and the batch process will abort. However the important part is that the
existing backup script approach will succeed if all your copies of the
Profile.cmd are modified accordingly.

TeraByte Support
 
Posts: 2324
Joined: Thu May 05, 2011 3:37 pm


Return to Scripting

cron