473,387 Members | 1,925 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,387 software developers and data experts.

Shell to DOS

ngr
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated whereas
it works directly from DOS.

Mar 27 '06 #1
5 3105
Hi maybe you can try it with a process:

Dim psi As New ProcessStartInfo
Dim p As New Process

psi.FileName = "your dos program"
psi.WorkingDirectory = "the working directory"
psi.WindowStyle = ProcessWindowStyle.Hidden
psi.Arguments = "the arguments for your dos command"
p.StartInfo = psi
p.Start()
p.WaitForExit()

hth

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"ngr" <ng*@tdrd.freeserve.co.uk> schreef in bericht
news:o9********************@karoo.co.uk...
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated whereas
it works directly from DOS.

Mar 27 '06 #2
ngr wrote:
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated whereas
it works directly from DOS.

Are you sure you're looking in the right directory for that textfile?
Your command prompt may open on a different directory then you expect
and therefore place the textfile somewhere where you don't expect it..
do a search of your system for it. Maybe you should redirect to a full
pathname i.e.

ROUTE PRINT > C:\FRED.TXT
--
Rinze van Huizen
C-Services Holland b.v
Mar 27 '06 #3
ngr,

You can try this one on our website

http://www.vb-tips.com/default.aspx?...b-23cab5aa1049

I hope this helps,

Cor

"ngr" <ng*@tdrd.freeserve.co.uk> schreef in bericht
news:o9********************@karoo.co.uk...
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated whereas
it works directly from DOS.

Mar 27 '06 #4
"ngr" <ng*@tdrd.freeserve.co.uk> schrieb:
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated whereas
it works directly from DOS.


You'll have to start "cmd" (or "%COMSPEC%") instead of your application
because the '>' feature is a feature of the command shell. You can pass the
command string to "cmd" in the command line.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 27 '06 #5
ngr
Resolved the piping issue by creating a batch file and calling that
directly.
Messy but it works.

Terry

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OP****************@TK2MSFTNGP10.phx.gbl...
"ngr" <ng*@tdrd.freeserve.co.uk> schrieb:
I want to be able to shell to DOS to pipe the contents of something to a
file which can then be read in by VB.

Example

Shell to DOS and then run ROUTE PRINT > FRED.TXT

return to VB and then open fred.txt to do sometning with that.

My attempts have so far failed as no piped file has been generated
whereas it works directly from DOS.


You'll have to start "cmd" (or "%COMSPEC%") instead of your application
because the '>' feature is a feature of the command shell. You can pass
the command string to "cmd" in the command line.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 27 '06 #6

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

Similar topics

3
by: John Bowling | last post by:
I'm creating a routine (not in a browser) to move multiple files on a daily basis to a backup directory. It can be done easily by call shell functions like 'mv file* newdir'. I can't find any...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
6
by: Lauren Wilson | last post by:
Hi folks, In an A2K app, I have attempted to use the following command in some VBA code with IDENTICAL results with every single version of the following: Shell "outlook.exe", vbHide Shell...
8
by: Mike | last post by:
Am trying to open a Microsoft Word .doc file using Access 2000 with Shell function (on Windows XP Operating system) Here is the code : Shell "C:\Program Files\Microsoft...
5
by: bearophileHUGS | last post by:
For array.array "B" means unsigned char, and such arrays accept to be initialized from (str) strings too, this is quite useful: But it seems such capability isn't shared with the append: ...
3
by: George Sakkis | last post by:
I'm trying to figure out why Popen captures the stderr of a specific command when it runs through the shell but not without it. IOW: cmd = if 1: # this captures both stdout and stderr as...
21
by: Tom Gur | last post by:
Hi, It's seems that csh and tcsh acts a bit different when handling special characters in quotes. i.e: if i'll supply my program with the following arguments: -winpath "c:\\temp\\" tcsh will...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
3
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I...
7
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.