title: Can I make a batch file execute a specific command based on hostname?
body: <p>I'm writing a simple batch file to assist users in migrating their data as they move from a laptop to a new VDI machine.</p>
  
  <p>I've been providing them with two batch files. One to run while on their laptop (DataUploader.bat) and one to run once they get logged in to their VDI machine (DataDownloader.bat)</p>
  
  <p>I'm hoping that I can use one batch file to simplify the process. I was thinking about doing a hostname check since all of their laptop machine names  begin with the same 3 letter and their VDI machines all begin with the same three letters. </p>
  
  <p>For example...</p>
  
  <p>If hostname begins with PPP GOTO DataDownLoad section of batch file</p>
  
  <p>If hostname begins with VVV GOTO DataUpload section of batch file</p>
  
  <p>I know I could output the hostname to a txt file but I'm curious how I could use a batch file to look at that text and only use the first three characters to GOTO a specific step in the batch file.</p>
  
  <p>I'm also open to any other creative solutions anyone may have other than using the hostname.</p>