Hello, i just tried around with wget.exe for windows.
i set a new environment variable like this:
name: wpath
value: D:\Downloads\wget\
So in cmd it works fine with:
wget -P %wpath% [file-url]
but in powershell it doesnt work. It creates a %wpath% folder in the current dir.
Any ideas why?
Thanks
-
See help about_variables in PowerShell. Hint: Use the $-sign, as in $wpath...
-
this one didnt work either:
wget -P $wpath [file-url]
-
Christoph.krn Notebook Evangelist
Try using:
Code:wget -P $env:wpath [file-url]
-
oh perfect, worked
thanks but is there any way to make it less "compliated/shorter" ?
@edit:
okay i found out, there is a way u can create a wget.ini and set the standart download direcoty.
but i got another question then:
i can use this command to put the outcome into a new file:
ipconfig | out-file "ipconfig.txt"
to set a path where to create it:
ipconfig | out-file C:\ipconfig.txt
now i want to set the path via a variable and it would be:
ipconfig | out-file $env:wpath ipconfig.txt
or smth similiar? but havent found which way it is yet
thanks -
Can't you do:
$env:wpath\ipconfig.txt
or:
${env:wpath}\ipconfig.txt
Am I missing something?
powershell & environment variables
Discussion in 'Windows OS and Software' started by zakazak, Jan 26, 2010.