I have an executable program that runs in several pc's in a network. At first it gets the host name (pc-001.. pc-013 etc). Then i need to mount a network drive (server1) on even pc's and (server2) on odds one based on its host name.
My problem is that i use system call to run dos command 'net use' for example
system ("net use x: \\\\server1\\shares /user:username pass");
How can i pass a variable to username? username is the host name which i know its value and pass is the same for all computers.