News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Batch file mystery

Started by jj2007, May 30, 2022, 09:08:20 PM

Previous topic - Next topic

jj2007

As posted earlier here: Works fine in Windows 7-64, but Windows 10 needs the inverse logic of if not exist, i.e. it works only if you use

if exist \Masm64\bin\ml64.exe (
  echo You need to download ml64.exe

I can't see any error in my code. Googling "windows 10" "batch" "if" "else" "not exist" reveals that Micros*t wants us to abandon batch files and use PowerShell instead. This is madness :cool:


if not exist D:\masm64\bin\ml64.exe echo dammit, no ml64
if not exist D:\Masm64\bin\RC.exe echo dammit, no rc
if not exist D:\masm64\bin\polink.exe echo dammit, no polink


3x dammit, and of course the files exist. They even work, i.e. they assemble the source just fine...!

This works fine, no "dammit":
if not exist D:\masm32\bin\ml.exe echo dammit, no ml32
if not exist D:\Masm32\bin\RC.exe echo dammit, no rc32
if not exist D:\masm32\bin\polink.exe echo dammit, no polink32


hutch--

 :biggrin:

This runs on my win 10 OK.

@echo off

  if exist ml64.exe goto yes

  @echo Nope its not there
  goto bye

:yes
  @echo yirp !

:bye
  @echo Thats all folks !

  pause

jj2007

Thanks, Hutch - your code made me find the error :thumbsup: