Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Evironment Variables
#1
Here is a line from my T.S. Menu which works:

hosts :run "notepad" "C:\Windows\system32\drivers\etc\hosts"

however, I would like to retreive "C:\Windows" dinamically from the %windir% variable (I have multiple OS installed) and I would like to keep it as one line in the T.S. Menu.
OS is XP or 2000.

I am stumbling on this.
Any help is welcomed.

Cheers
#2
$Windows$ wont do it?
#3
Special folders and environment variables are not automatically expanded in run's second argument. Use str function expandpath.

hosts :run "notepad.exe" _s.expandpath("$windows$\system32\drivers\etc\hosts")

or

hosts :run "notepad.exe" _s.expandpath("%windir%\system32\drivers\etc\hosts")

_s is str variable that does not need to be declared.
#4
Awesome!!

Thanks


Forum Jump:


Users browsing this thread: 1 Guest(s)