0

I started learning command line yesterday. My supervisor asked me to delete extra com ports.

I was trying to delete com port using command line. Right now I am using devcon.exe that is a part of windows WDK. I have tried using devcon findall =ports and used devcon remove "@some specific id". It worked totally well.

so I start to create a for loop of command line using the following query

for /f %%i in ('devcon findall %1') do (devcon remove "@%%i")

But, It does not work. Would someone help me with that? Any advice will be appreciated.

jscott
  • 24,484
  • 8
  • 79
  • 100
Mr_U4913
  • 101
  • it seems like i accidentally delete your comment. So sorry!! Do I need to add * to the query? like 'for /f %%i in ('devcon findall **%1**') do (devcon remove "@%%i")' – Mr_U4913 Feb 09 '17 at 20:01
  • @jscott Sorry to bother you again. To remove all com ports, I rewrite the batch file like the following: for /f %%i in ('devcon findall =ports') do (devcon remove "@%%i") – Mr_U4913 Feb 09 '17 at 20:22

0 Answers0