View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
external usenet poster
 
Posts: 504
Default How to get data from CMD line

I dont think its going to work for me, the CMD app that Im running doest even
have a way to select and copy with the keyboard. I cant even hit Alt to get
a drop down menu. The only way to get hte options to come up is to right
click the title bar. This is a lousy interface.....

Is there a sendkey command for mouse functions??

Unfortunatly I dont know anything about using the API, and dont know if that
will work either.

"Bill Pfister" wrote:

Try using SendKeys (the API version is more robust than the Excel
implementation) to send a Select All / Copy. Then you can read the clipboard
and parse in Excel. Not the best solution but it should work.

Regards,
Bill


"Kevin" wrote:

Unfortunatley that wont work for me, the CMD shell Im using is a striped down
version for a storage array and I cannot change directories or direct to a
file. It is a CMD window that is interating with the storage array and the
commands are VERY limited. the only way I can get the data into excel now is
to select the text and paste it. The only traditional CMD functions I have
on it are to right click the title bar and choose Mark,Copy, Paste, Select
all, Scroll and Find.

"moon" wrote:


I think it's less work if you just send your output to a file.
So 'C:\dir' gives a directory, but to flush the directory contents into a
text file, use:
C:\dir C:\dir.txt

Once you have the text file, it's quite easy to open that with Excel.


"Kevin" schreef in bericht
...
I need a way to run a command in the CMD window and retrieve the output
back
into Excel. Is there a way to do this?

For example if my output below is in the CMD window I want to capture the
Items starting with DEVA.
------------------------------------------------
Systems available on this Manager:
DEVA01-0BF0
DEVA02-0290
DEVA03-0CD0
NoSystemSelected
------------------------------------------------