title: Connect to an ad-hoc-network in windows 10 only via command line
body: <p>I am currently writing a .bat script in which you can choose whether you want to create an ad-hoc-network or connect to one, to make it easy for everyone to connect within windows 8, 8.1 and 10 as the GUI setup was removed.</p>
  
  <p>Well, creating was easy.</p>
  
  <pre><code>netsh wlan set hostednetwork mode=allow ssid=adhocnetwork key= password
  netsh wlan start hosted network 
  pause
  </code></pre>
  
  <p>But when I want to connect to a network via <code>netsh wlan connect adhocnetwork</code>, it says there is no profile called 'adhocnetwork'.
  I figured that you first have to create a profile with the network GUI.</p>
  
  <p>So my question is now if there is a way to create a network profile with the command line, so that I can implement that into the bat file.</p>
  
  <p>Thanks for every answer!</p>
  
  <p>Best greetings,</p>
  
  <p>Bant</p>