char   cname[256];
GetComputerName(cname,(LPDWORD)&len);
 
Thanks
Shaffiq Ahamed
System Programmer

bretedward <[EMAIL PROTECTED]> wrote:

I am building up a filename in a C program. I would like to
include the host name (computer name) of the machine that the script
runs on. The script will be run on many different (all same OS and
version) machines, so the host name will change depending on which
machine the script is executed on.

There is a DOS command "hostname" that returns the host name to the
screen.

I have tried using it directly in my C program with no
success. My program thinks that hostname is a variable and
stops because it has not been declared. I have also tried using
hostname as the argument for the system command -> system(hostname).
This also does not work.

I am able to use the DOS command, mkdir, directly in my program. I
was hoping to be able to do the same with hostname.

I would like to capture the host name in a string var iable in my
script.


Thanks,

Bret





To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.



Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.

To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5526708.6599542.3001176/D=groups/S=:HM/A=2372354/rand=474814640


Yahoo! Groups Links

Reply via email to