SHARE
TWEET

Untitled

a guest Jun 17th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SET MYVAR="Hello World"
  2. ECHO %MYVAR%
  3.      
  4. @echo off
  5. rem Paths to combine
  6. set DIRECTORY="C:Directory with spaces"
  7. set FILENAME="sub directoryfilename.txt"
  8. echo %DIRECTORY%
  9. echo %FILENAME%
  10.  
  11. rem This is just to illustrate how the = operator works
  12. set DIR_WITHOUT_SPACES=%DIRECTORY:"=%
  13. echo %DIR_WITHOUT_SPACES%
  14.  
  15. rem Combine two paths
  16. set COMBINED="%DIRECTORY:"=%%FILENAME:"=%"
  17. echo %COMBINED%
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top