Article ID: 149570
Article Last Modified on 10/10/2006
DIR, CLS, DEL, CD, MD, RD, MKDIR, RMDIR, COPY
MS-DOS command Microsoft VBA command
-----------------------------------------------------------------------
DEL [drive][path]filename Kill "[drive][path]filename"
CD [drive][path] ChDir "[drive][path]"
MD [drive][path]directory name MkDir "[drive][path]directory name"
RD [drive][path]directory name RmDir "[drive][path]directory name"
COPY [source] [destination] FileCopy "[source]","[destination]"
DIR [path] Dir("[path]",[attributes])
Note The Visual Basic for Applications Dir command does not function
identically to its MS-DOS equivalent, and requires extra code to
retrieve an entire directory.
dir
a = Shell("command.com /c [command]", [WindowStyle])
Note You must include /c for the command to be executed correctly. For
example, to perform a directory command of all hidden files in the root
directory, use the following syntax:
Shell("command.com /c dir c:\ /ah", 1)
a = Shell("MEM /C /P", 1)
Compare this to the output of the MEM command when you run it from an MS-
DOS session under Windows or Windows 95. The only difference is that
Command.com is not in memory within the environment created by the
Visual Basic for Applications Shell function.
Additional query words: 5.00c 8.00 XL95 Acc2
Keywords: kbprogramming KB149570