Create a new console app project, paste the code in and compile. There's your demo.
Note that it doesn't work when launched from Visual Studio's IDE. You need to launch (double-click or run from the command line) the .exe yourself. When launched from the IDE, the title bar text is enclosed in double quotes...
thanks,
i needed to shutdown my computer from another room so i will create a program that will read commands from a file and the other program will write to that file remotely.
do you know how i can get the shutdown -s -f -m \\dan
working. all computers have pro on it just says, i don't have the right permision. i have looked up to 15 pages on google and i could not find anything that worked
The obvious question to this problem is, are you using the same username/password combination on both computers? If you're logged on to PC1 as "bob" and try to shutdown PC2 remotely, PC2 needs a user account "bob" with the same password as "bob" on PC1. "bob" would also need the correct permissions to do this.