Using cmd.exe commands on a Form Command Button

Using cmd.exe commands on a Form Command Button

Post by mcesche » Fri, 05 Jan 2007 05:10:40


Use a batch file that redirects the output to a text file and then read
the data in.

Hint: use Dev Ashish's excellent Shell and Wait code.
http://www.yqcomputer.com/

<<Air code>>

<MyBatchFile.bat>
@echo off
getmac /s %1 >MyTextFile.txt
</MyBatchFile.bat>

Private Sub GetInfo_Click()
Dim strShellCmd As String
strShellCmd = "path\MyBatchFile.bat " & me.NodeName
ShellWait strShellCmd
DoCmd.TransferText path\MyTextFile.txt
'Read your information out of the imported table
End Sub

It's almost too easy... B-)
Hope this helps,
Chris M.
 
 
 

1. way to make "command.com" default command processor instead of cmd.exe ?

2. Command Prompt (cmd.exe) command line interface

Is there a web page that describes the use of cmd.exe as
a command line interface?

I'm trying to figure out what the right-click --> Scroll selection does.

By experimentation by right-clicking inside a Command Prompt window:

right-click --> Mark initiates text selection
right-click --> Copy selects text
right-click --> Paste pastes text selection to current oommand
right-click --> Select All selects all text in the buffer
right-click --> Scroll ???
right-click --> Find selects text after finding in in the buffer

Notes:
Copy
o must be invoked by the Enter key as the menu entry is
always greyed out
o right-click after marking text is also is a keyboard shortcut for
Copy

Scroll
o Greys out Mark and Paste until a selection is made, but I can't
figure out what it is used for


- Larry

3. Textbox + Button ? launching command from "cmd.exe" How?

4. Textbox + Button ? launching command from "cmd.exe" How?

5. Cannot execute command line program in cmd.exe under aspx form

6. Problem with DOS paths in perl - cmd.exe vs. command.exe

7. cmd.exe , ntvdm.exe , command.com ...don't work

8. Perl 5.8.0, calling ext. commands: how to force CMD.EXE instead of sh.exe?

9. VB's Command Button vs Form's Command Button

10. Userform Command Button not available until another command button has been used

11. CACLS command for cmd.exe?