News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Win 2000 Batch Test

Started by dedndave, March 17, 2013, 06:01:20 AM

Previous topic - Next topic

dedndave

i am doing some work on batch files
i would appreciate it if someone with Windows 2000 could test this for me and post the results
i want to verify that these are supported   :P

the batch file.....
@echo off
setlocal
set tempparm=%cd%
echo %~1
echo %~f1
echo %~d1
echo %~p1
echo %~n1
echo %~x1
echo %~s1
echo %~a1
echo %~t1
echo %~z1
echo %~dp1
echo %~fs1
echo %~nx1
echo %~ftza1
echo %tempparm%


the commandline and results under XP SP3
C:\Documents and Settings\Dave\Desktop => btest "btest.bat"
btest.bat
C:\Documents and Settings\Dave\Desktop\btest.bat
C:
\Documents and Settings\Dave\Desktop\
btest
.bat
C:\DOCUME~1\Dave\Desktop\btest.bat
--a------
03/16/2013 11:56 AM
214
C:\Documents and Settings\Dave\Desktop\
C:\DOCUME~1\Dave\Desktop\btest.bat
btest.bat
--a------ 03/16/2013 11:56 AM 214 C:\Documents and Settings\Dave\Desktop\btest.b
at
C:\Documents and Settings\Dave\Desktop

C:\Documents and Settings\Dave\Desktop =>


notice that the parameter must be surrounded by double-quotes,
and the file must exist, in order for me to get the results i need

i know i could use PUSHD/POPD, but i am not sure about the level of support
from what i can see, they are not supported under win 2000

many thanks in advance   :t

FORTRANS

Hi Dave,


G:\WORK>BTEST "btest.bat"
btest.bat
G:\WORK\BTEST.BAT
G:
\WORK\
BTEST
.BAT
G:\WORK\BTEST.BAT
--a------
03/17/13 10:36a
214
G:\WORK\
G:\WORK\BTEST.BAT
BTEST.BAT
--a------ 03/17/13 10:36a 214 G:\WORK\BTEST.BAT
G:\WORK

G:\WORK>


   ???  Weird stuff.  Anyway, "Microsoft Windows 2000 [Version 5.00.2195]".

Regards,

Steve N.

dedndave

thanks, Steve   :t
that's what i needed

i won't use all of these - at least not in one batch file - lol
but, i needed to know which ones worked

dedndave

#3
here is the "meat grinder" front end for the Bild.bat batch file i am working on
only the working parms are shown, for now
the easy stuff is to do the actual build - lol

it will accept spaces in the path or the asm file name, so long as they are surrounded with ""
and - it will allow extension/no-extension file name
it is designed to be used from the command line, or from the right-click context menu
@echo off
setlocal
if "x%~1"=="x" goto AsmUsage
if "x%~x1"=="x" goto ExistTest
set BTempExt=%~x1
set BTempExt=%BTempExt:A=a%
set BTempExt=%BTempExt:S=s%
set BTempExt=%BTempExt:M=m%
if not %BTempExt%==.asm goto AsmUsage
:ExistTest
if not exist "%~dpn1.asm" goto AsmUsage
set BTempBin=%~dp0
if not %~d0==%~d1 goto AsmDrive
if not exist %~d0\Masm32\Include\Windows.inc goto AsmDrive
if not exist %BTempBin%\ml.exe goto AsmDrive

set BTempPrm=W
if "x%~2"=="x" goto ParmsOk
set BTempPrm=%~2
set BTempPrm=%BTempPrm:w=W%
set BTempPrm=%BTempPrm:c=C%
set BTempPrm=%BTempPrm:d=D%
set BTempPrm=%BTempPrm:s=S%
set BTempPrm=%BTempPrm:o=O%
set BTempPrm=%BTempPrm:l=L%
set BTempPrm=%BTempPrm:e=E%
if %BTempPrm%==W goto ParmsOk
if %BTempPrm%==C goto ParmsOk
if %BTempPrm%==D goto ParmsOk
if %BTempPrm%==S goto ParmsOk
if %BTempPrm%==O goto ParmsOk
if %BTempPrm%==L goto ParmsOk
if %BTempPrm%==E16 goto ParmsOk
if %BTempPrm%==C16 goto ParmsOk
if %BTempPrm%==S16 goto ParmsOk
if %BTempPrm%==O16 goto ParmsOk
if %BTempPrm%==L16 goto ParmsOk

:AsmUsage
echo.
echo Usage: Bild AsmFile [W^|C^|D^|S^|O^|L^|E16^|C16^|S16^|O16^|L16]
echo AsmFile = AsmFile.asm (extension must be .asm, assumed if not present)
echo W       = Windows32 EXE (default)
echo C       = Console32 EXE
echo D       = Windows32 DLL
echo S       = Native32  SYS
echo O       = Object32  OBJ
echo L       = Library32 LIB
echo E16     = 16-bit    EXE
echo C16     = 16-bit    COM
echo S16     = 16-bit    SYS
echo O16     = 16-bit    OBJ
echo L16     = 16-bit    LIB
echo.
goto BatchExit

:AsmDrive
echo.
echo The project folder must be on the same drive as the Masm32 folder.
echo The Masm32 folder must be in the root of that drive.
echo Bild.bat and the binaries must be in ?:\Masm32\Bin.
echo It is helpful if the ?:\Masm32\Bin folder is in the PATH.
echo.
goto BatchExit

:ParmsOk
set BTempDir=%cd%
set BTempPrj=%~n1
cd /d "%~dp1"



:: test display of working parms

echo %BTempPrm%
echo %BTempDir%
echo %BTempPrj%
echo %BTempBin%
cd



:BatchEnd
echo.
dir "%BTempPrj%.*" /o-d
echo.
cd /d "%BTempDir%"

:BatchExit
pause


EDIT: updated batch code, 3-18

dedndave

i modified the previous post
Hutch will appreciate this one   :biggrin:

echo The project folder must be on the same drive as the Masm32 folder.
echo The Masm32 folder must be in the root of that drive.
echo Bild.bat and the binaries must be in ?:\Masm32\Bin.
echo It is helpful if the ?:\Masm32\Bin folder is in the PATH.


should save us a little typing in the forum - lol

dedndave

#5
a set of ML/LINK switches for different build types
any comments or suggestions would be helpful

                 masm                      link32                                                     link16

Windows32 EXE  /c /coff  /SUBSYSTEM:WINDOWS /OPT:NOREF,NOICF,NOWIN98
Console32 EXE  /c /coff  /SUBSYSTEM:CONSOLE /OPT:NOREF,NOICF,NOWIN98
Windows32 DLL  /c /coff  /SUBSYSTEM:WINDOWS /OPT:NOREF,NOICF,NOWIN98 /DEF:%Proj%.def (/DEF if def file exists)
Native32  SYS  /c /coff  /SUBSYSTEM:NATIVE /DRIVER /ALIGN:32 /OPT:NOREF,NOICF /BASE:0x10000 /OUT:%Proj%.sys
Object32  OBJ  /c /coff  (not linked)
Library32 LIB  /c /coff  /LIB
16-bit    EXE  /c                                                                                 (no switches used)
16-bit    COM  /c                                                                                 /TINY (exe renamed to com)
16-bit    SYS  /c                                                                                 /TINY (exe renamed to sys)
16-bit    OBJ  /c                                                                                 (not linked)
16-bit    LIB  /c                                                                                 (not linked) (requires Lib16.exe)

dedndave

learn something new, every day - lol
the /c and /coff switches for ML must be lower case   :P