Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi;
I want to write vb login screen and it will run a dos command.
for example :
login ID : a
password : b
c is a fix value
after press ok button will be process a dos command X+a+b+cCan u help me ?
Thank youFrank

you can't run every dos command using shell
for ecample dir
OCX should be such that it returns output of the command.
can anyone help me regarding this ?
shabdar

Try this
--
Dim taskID as Double
taskID = Shell("C:\winnt\system32\cmd /C dir > file1.txt", 0)
--Should work in NT4 and W2K.
The return value [taskID] is a handle to the aplication started, in this case it can safely be ignored.
[cmd] is windows interpretator for classical command line DOS and [C:\winnt\system32\] is the path to it.
The switch [/C] tells cmd to run the input string and then exit.
[dir > file1.txt] is the DOS command and thus the input string to cmd.
The last argument, [0], hides the new window that shell starts for the external application.
To locate the output file, use [App.Path] to find out in which directory it ended up.
Good luck

This a much better solution to the above problem:
taskID = Shell(Environ$("Comspec") & " /c dir > file1.txt", 0)

i run ping command on sql mode by help $
e.g. $ping 172.16.8.1then i find the particular server link is down or not .
i want to store the result of ping command on database by using VB or c++.
plz explain the way by which i can do this ?

![]() |
ROUTINE CALLS?
|
COBOL complier
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |