Tag: cmd

C#

Execute system command in C#

Execute system commands in C# using Process and ProcessStartInfo classes. Code void ExecuteCommand(String command) { Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.WindowStyle = ProcessWindowStyle.Hidden; startInfo.FileName = "cmd.exe"; startInfo.Arguments = "/C " + command; process.StartInfo = startInfo; process.Start(); process.BeginOutputReadLine(); process.WaitForExit(); }void ExecuteCommand(String command) { Process process = new Process(); ProcessStartInfo startInfo = …

Microsoft Windows

View Hard Drive Partitions with DiskPart in Windows

1. Open command line (cmd) in your Windows machine. 2. Type diskpartdiskpart 3. You will be prompted for administrator password and a new command line window will open. 4. Type: list disklist disk to list all available hard disks. 5. Select your disk: for ex. select disk 0select disk 0 6. List partitions: list partitionlist …

Windows 7

Change user password from the command line – Win7

If you would like to quickly change user password without having to enter the control panel: 1. Open command line with administrative rights 2. Issue the following command: net user username password examples: net user akarpouzas 12345678 do not use so simple passwords, this is just an example and, net user “Thanos Karpouzas” 12345678 if …