I'm trying to create a batch file with that uses wget / nircmd.exe. i have install path set to "%appdata%"\whatever the problem comes when i run this batch file on my second computer which contains a space in the name of the user. wget seems to try and save it to c:\users\klaus and ends up writing a file called Klaus. when i need it to install to C:\Users\Klaus Schroder\AppData\Roaming\DriverPack
this is what i get, trying to figure out a way to make wget to save to directories with spaces as well as directories without spaces. does it not recognize the %appdata% as C:\Users\Klaus Schroder\AppData\Roaming\?
C:\Users\Klaus Schroder\AppData\Local\Temp>SET INSTALLPATH="C:\Users\Klaus Schro
der\AppData\Roaming"\DriverPack
C:\Users\Klaus Schroder\AppData\Local\Temp>mkdir "C:\Users\Klaus Schroder\AppDat
a\Roaming"\DriverPack
HTTP request sent, awaiting response... 200 OK
Length: 527960 (516K) [application/x-msdownload]
Saving to: 'C:/Users/Klaus'
C:/Users/Klaus 100%[=====================>] 515.59K 184KB/s in 2.8s
2015-03-30 22:47:03 (184 KB/s) - 'C:/Users/Klaus' saved [527960/527960]
--2015-03-30 22:47:03-- http://schroder%5Cappdata%5Croaming%5Cdriverpack%5Crar.
exe/
Resolving schroder\\appdata\\roaming\\driverpack\\rar.exe (schroder\\appdata\\ro
aming\\driverpack\\rar.exe)... failed: The requested name is valid, but no data
of the requested type was found. .
wget: unable to resolve host address 'schroder\\appdata\\roaming\\driverpack\\ra
r.exe'
FINISHED --2015-03-30 22:47:03--
Total wall clock time: 4.1s
Downloaded: 1 files, 516K in 2.8s (184 KB/s)
SET INSTALLPATH problem
Moderator: DosItHelp
Re: SET INSTALLPATH problem
You probably need double quotes in your wget command.
Re: SET INSTALLPATH problem
Neither of these commands have the double quotes in the correct position. You need to surround the WHOLE path with double quotes.
I personally do not put quotes into the file path when I am assigning it to a variable. Just use quotes when you are executing the command.
vipez21 wrote:C:\Users\Klaus Schroder\AppData\Local\Temp>SET INSTALLPATH="C:\Users\Klaus Schroder\AppData\Roaming"\DriverPack
C:\Users\Klaus Schroder\AppData\Local\Temp>mkdir "C:\Users\Klaus Schroder\AppData\Roaming"\DriverPack
I personally do not put quotes into the file path when I am assigning it to a variable. Just use quotes when you are executing the command.
Code: Select all
set installpath=C:\some path\with spaces\
mkdir "%installpath%"
Re: SET INSTALLPATH problem
vipez21 wrote:SET INSTALLPATH="C:\Users\Klaus Schroder\AppData\Roaming"\DriverPack
Windows can handle some really strange methods of double quoting, such as the above too.
Some tools may fail - but most will work happily.
Squashman wrote:Just use quotes when you are executing the command.Code: Select all
set installpath=C:\some path\with spaces\
mkdir "%installpath%"
True, except the set command should have double quotes around it all as shown below
- because an & in the path will break the set command without them. You know that, I'm just spelling it out for the OP.
set "installpath=C:\some path\with & and spaces\"