Answers for "batch script if statement"

0

batch script if statement

@echo off 
SET str1 = String1 
SET str2 = String2 

if %str1%==String1 (echo "The value of variable String1") else (echo "Unknown value") 
if %str2%==String3 (echo "The value of variable c is String3") else (echo "Unknown value")
Posted by: Guest on September-03-2021
0

check value is number in cmd

#!/bin/bash

var=a

if [ -n "$var" ] && [ "$var" -eq "$var" ] 2>/dev/null; then
  echo number
else
  echo not a number
fi
Posted by: Guest on October-16-2020
0

check value is number in cmd

echo off &echo.&echo off
set /p pilih=silahkan masukan adb port ? &
echo off &echo.&echo off

SET /a param="%pilih%" + 0

if not %param% == 0 echo hello wordl
pause
Posted by: Guest on October-16-2020

Browse Popular Code Answers by Language