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

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?
 
J

Jack Leach

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)
 
J

Jack Leach

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top