PC Review


Reply
Thread Tools Rate Thread

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

 
 
Blaze
Guest
Posts: n/a
 
      19th Mar 2010
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?
 
Reply With Quote
 
 
 
 
Jack Leach
Guest
Posts: n/a
 
      19th Mar 2010
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)



"Blaze" wrote:

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

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      19th Mar 2010
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)



"Jack Leach" wrote:

> 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)
>
>
>
> "Blaze" wrote:
>
> > 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?

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      19th Mar 2010
and one last thing... I've had this sitting around for a while and never
tried it, but you apparently can read the output lines of whatever command
you run... could come in quite handy

http://www.j.nurick.dial.pipex.com/C.../vbPerlish.htm

--
Jack Leach
www.tristatemachine.com

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



"Jack Leach" wrote:

> 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)
>
>
>
> "Jack Leach" wrote:
>
> > 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)
> >
> >
> >
> > "Blaze" wrote:
> >
> > > 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?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 Security 6 1st May 2006 02:51 PM
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 Networking 1 29th Apr 2006 02:42 AM
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 1 29th Apr 2006 02:05 AM
Re: How do I access "My Computer" or "Control Panel" using a command prompt? roger Windows XP Help 0 12th May 2004 05:38 PM
RE: How do I access "My Computer" or "Control Panel" using a command prompt? =?Utf-8?B?ZG9nZ2Vy?= Windows XP Help 0 12th May 2004 05:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:01 AM.