Newbie needs help Using DOS in VB 
Author Message
 Newbie needs help Using DOS in VB

At a dos prompt I can type:
Net time \\ server name
and it will return the server date and time.

I want to do this from a vb module.
Using Shell(environ$(comspec)) will open the dos window

 I don't want to update the workstation clock I just want the returned
text string entered into a form

How do I get the Net Time command to type at the dos prompt and then
how do I retrieve the returned text string?

Thanks for helping this newbie



Sat, 01 May 2004 22:56:13 GMT  
 Newbie needs help Using DOS in VB
Hi Martin,
I did something like this a
while ago and I still don't know
if there's an easier way.
I suspect not.

Redirect the output of the DOS
command to a text file.
Example:
ping 123.44.56.3 >C:\testping.txt

Open the file and extract the contents.
In my case I went through a few contortions
to get the ping time. (But now I know how to ping
directly from VB!)

Not easy, but possible.

HTH
Dan Artuso, MVP

Quote:

> At a dos prompt I can type:
> Net time \\ server name
> and it will return the server date and time.

> I want to do this from a vb module.
> Using Shell(environ$(comspec)) will open the dos window

>  I don't want to update the workstation clock I just want the returned
> text string entered into a form

> How do I get the Net Time command to type at the dos prompt and then
> how do I retrieve the returned text string?

> Thanks for helping this newbie



Sun, 02 May 2004 08:08:11 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need Report to look at SQL Data source ( VB / CR newbie needs help)

2. Please Help Newbie Crystal Report / VB help needed.

3. Newbie needs help in reading installed programs from the registry using RegObj.dll

4. VB6 - Newbie needs SQL help sorting using dates in Access DB

5. Newbie needs help editing data using IIS/webclasses

6. Newbie: Needs Help on Using Access Picture (OLE) Fields in VB6.0 Form

7. Using DBList boxes (Newbie help needed)

8. Newbie needs help in reading installed programs from the registry using RegObj.dll

9. Newbie needs help in reading installed programs from the registry using RegObj.dll

10. vbscript newbie needs help using DateDiff - getting headache tryi ng to figure out logic

11. newbie needs help editing data using IIS/webclasses

12. Newbie needs help in reading installed programs from the registry using RegObj.dll

 

 
Powered by phpBB® Forum Software