473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to invoke system command from VBA?

Hi,

I just need to do something simple like

dir > dir.txt

from Access. In C I could simply do

system("dir > dir.txt");

or specify the desired command as a string but I couldn't locate anything
similar for VBA. Does anyone know this off top of their head? Essentially I
want to open another application by clicking a button on an Access form.

Thanks!
Nov 12 '05 #1
2 8044
"Kenmlin" <ke*****@aol.com> wrote in message
news:20***************************@mb-m06.aol.com...
Hi,

I just need to do something simple like

dir > dir.txt

from Access. In C I could simply do

system("dir > dir.txt");

or specify the desired command as a string but I couldn't locate anything
similar for VBA. Does anyone know this off top of their head? Essentially I
want to open another application by clicking a button on an Access form.


Shell "dir > dir.txt"

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2
On 11 Apr 2004 15:52:39 GMT, Kenmlin wrote:
dir > dir.txt

from Access. In C I could simply do

system("dir > dir.txt");


If it's just about opening another application, next to "shell" you can use
"FollowHyperlink" on the document name.

If you want to execute the dir command, this syntax is better:

Shell Environ$("COMSPEC") & " /c dir > c:\dir.txt"

Peter

--
No mails please.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: AznCollegeGuy | last post by:
Hello, Im trying to invoke a simple perl script with in my visual c++ gui program to with c++'s system call feature: when i call: system("dir"); it works
7
by: DB_2 | last post by:
Hello, I was trying to load a comma-separated text file to a DB2 table. I believe I have the syntax rigt for the LOAD command. My first question is, how do you actually run it? It is not a...
7
by: Jeff Stewart | last post by:
I need a thread to run a subroutine which updates my main form's progress bar. I've properly marshaled all UI updates to the main UI thread, and after the main thread starts the worker thread, it...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
2
by: Glenn Venzke | last post by:
I'm trying to print an Adobe forms file (.fdf) using system.diagnostics.process in a windows service. The problem is, IE is the program that launches that file type & Verb = "Print" doesn't work in...
5
by: Lou Pecora | last post by:
I installed the SciPy superpackage and have pylab, matplotlib, scipy, and numpy apparently running well. But I want to use matplotlib/pylab interactively. The instructions suggest doing this in...
0
by: truthbajaj | last post by:
Hi, I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C. I created a shared lib (libextproc.so) for the following function. ...
2
by: =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post by:
vs2005, c# Trying to understand why one way works but the other doesnt. I have not tried to create a simpler mdi/child/showdialog app for posting purposes (I think even this would not be so small...
3
balabaster
by: balabaster | last post by:
I have a class that I want to make thread-safe and am investigating the ISyncronizeInvoke interface and wondering just what it will take to implement this interface. So far the basic concept of my...
3
by: Only-Trouble | last post by:
Hi all I am running openSUSE 10.3 I am learning python on my own, it seems like the system has already installed a python IDLE The question is how to invoke it? Thanks Only-Trouble
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.