Issue with a variable in my batch script -


i want script to:

  • accept variable
  • create path using variable input
  • display path
  • display contents of directory

what wrong following code? echo statement prints your directory set to; dir statement works expected.

@echo off set custompath = "c:\users\%1" echo  directory set %custompath% dir %custompath% 

it's space around =.

@echo off set custompath="c:\users\%1" echo  directory set %custompath% dir %custompath% 

check this post.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -