Question:
I’m trying to have the app tablacus explorer open a folder path. This works fine with the following formatting:
1 2 3 |
$ex = 'S:\Tools\explorer\TE64.exe' Start-Process $ex -ArgumentList '"Tabs,Close other tabs" "Open,C:\Program Files"' |
But I would really like to have the path in a variable ($dir = 'C:\Program Files'
), and I can’t seem to get the quotes right so it gets interpreted properly.
Thank you for your help.
Answer:
I found two solutions for this on the MS Blog:
1 2 3 4 5 6 |
$Args = @" "Tabs,Close other tabs" "Open,$dir" "@ start $ex -ArgumentList $Args |
or
1 2 |
start $ex -ArgumentList """Tabs,Close other tabs"" ""Open,$dir""" |