Create Subdirectory





QuickBasic


' DOS 2+ - MKDIR - CREATE SUBDIRECTORY

'$INCLUDE: 'qb.bi'

DIM pathname AS STRING
DIM inregs  AS RegTypeX
DIM outregs AS RegTypeX

pathname = "c:\int\test" + CHR$(0)  ' "c:\int" need to exist, "test" will be created
inregs.DS = VARSEG(pathname)
inregs.DX = SADD(pathname)
inregs.AX = &H3900

' DOS interrupt with sub-function &H39

CALL InterruptX(&H21, inregs, outregs)

IF outregs.FLAGS AND 1 THEN
   PRINT "Error creating >> " + pathname
   BEEP: END
END IF