Variable inside an IF not showing correctly
Posted: 08 Oct 2023 13:16
I can't get this script to work correctly. My syntax is wrong.
This is the script:
In the cmd window it shows as:
Could someone please help me fix the code?
This is the script:
Code: Select all
setlocal EnableDelayedExpansion
set wkdir=%cd%
set IP=192.168.1.2
Set "IPADDRESS=\\%IP%"
if %_OS%==64 (
Set "FileName=SecureVNCPlugin64.dsm"
if not exist "!FileName!" (
set "file=!file!!lf! ? %FileName%"
robocopy "%IPADDRESS%\Dnload\VNC" "%wkdir%" "!FileName!"
Echo "FileName = -" ^^^!FileName!
Echo "wrkdir = -" !wrkdir!
@Pause>nul|(@color 17&echo 3-%_OS%==64&@color)
IF NOT ERRORLEVEL 1 GOTO FileCopied)
)
Code: Select all
C:\Dnload\VNC>if 64 == 64 (
Set "FileName=SecureVNCPlugin64.dsm"
if not exist "!FileName!" (
set "file=!file!!lf! ? VNCsetup.reg"
robocopy "\\192.168.168.7\Dnload\VNC" "C:\Dnload\VNC" "!FileName!"
Echo "FileName = -" ^!FileName!
Echo "wrkdir = -" !wrkdir!
IF NOT ERRORLEVEL 1 GOTO FileCopied
)
"FileName = -" !FileName
"wrkdir = -"
3-64==64