


Adb Format Command Code For Better
Where am I going wrong? What I've already tried, in the searchesI've done: startInfo.Arguments = adb -s ""\" shell dumpsys battery" I would verify the Arguments property after you set it in the debugger. I've tried to concatenate, without success. Below is the code for better understanding, the first block is to get the serial number and transfer it to textBox1:System.Diagnostics.Process process = new System.Diagnostics.Process() System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo() StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden String output1 = process.StandardOutput.ReadToEnd() And the second block is the code that will direct the commands to the serial number: startInfo.FileName = "adb.exe" StartInfo.Arguments = "-s " + textBox1.Text + " shell dumpsys battery" String output = process.StandardOutput.ReadToEnd() But I can not get it to recognize the variable in the argument line. However I need to copy this serial number from this textBox and transferIt to a new ADB command in DOS to read the battery data.
If you do want to use cmd.exe then change the FileName to be cmd.exe instead. I would set FileName as adb.exe and then remove the /c adb fromThe arguments as they aren't needed. So the command wouldn't work. But you're setting FileName to adb directly. What seems suspect to me is thatYou're using /c adb which tells me you might be trying to call cmd.exe and passing the /c adb as the command to execute. If it doesn't work in the command prompt then it is wrong.
Posting the exception you get or the error code from theProcess would shed some light on what is going wrong.
