G
greg_chu
Hi, I know I can use ipconfig.exe is DOS to get my IP address, the
situation is I need to automat this process.
I need to write a DOS program which issue a command to run IPCONFIG to
get the IP address then issue a net use command to map a drive on the
network.
I know you can use system
system ('command.com /c ipcoinfig.exe")
or
system ('command.com ipcoinfig.exe")
the start the shell, but how do I capture the output from it?
after I capture the IP address then from the IP I can know which server
on the network I need to map to, so I can issue another
system("command.com net use z: \\xyzserver\myshare mypw /User:me")
to map the drive, I need to also check if the net use worked correctly.
Thanks!
Greg
situation is I need to automat this process.
I need to write a DOS program which issue a command to run IPCONFIG to
get the IP address then issue a net use command to map a drive on the
network.
I know you can use system
system ('command.com /c ipcoinfig.exe")
or
system ('command.com ipcoinfig.exe")
the start the shell, but how do I capture the output from it?
after I capture the IP address then from the IP I can know which server
on the network I need to map to, so I can issue another
system("command.com net use z: \\xyzserver\myshare mypw /User:me")
to map the drive, I need to also check if the net use worked correctly.
Thanks!
Greg