How can I run a ".cmd" command string from within MS Access?

  • Thread starter Thread starter Blaze
  • Start date Start date
B

Blaze

I would like to be able to execute the following command from within an MS
Access code module (FOR /F "delims=~" %%f in (Cust_and_DelAddr_Folders.txt)
DO MD "%%f") Which is normally run through "cmd.exe".

Is this possible?
 
Sure, use the Shell function...

Dim strCmd As String
strCmd = "rgsvr32 somefile.dll"
Shell strCmd


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Come to think of it, if you have this already in a cmd or bat file you can
shell the file itself...

Shell """C:\Progs and Settings\yourcmd.cmd"""


note that if you need quotes in a string to be shelled they have to be
included as they would for a where string.

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Back
Top