mhamer
asked on
open folder in powershell
hi, id like a powershell script to open a location
eg
when run the folder c:\data\test\%hostname%\to ols opens much like if there was a shortcut to it
power shell preffered VB ok
eg
when run the folder c:\data\test\%hostname%\to
power shell preffered VB ok
use Invoke-item:invoke-item c:\data\test\%hostname%\to ols
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great works perfectly thank you
what would be the vb equivilant? just out of interest? you get the points anyway
what would be the vb equivilant? just out of interest? you get the points anyway
in vb script:
Set objShell = CreateObject("WScript.Shell")
hostname = objShell.ExpandEnvironmentStrings("%hostname%")
objShell.Run "explorer c:\data\test\" & hostname & "\tools
ASKER
unterminated string constant when i use that
i forgot the " in line 3:
Set objShell = CreateObject("WScript.Shel l")
hostname = objShell.ExpandEnvironment Strings("% hostname%" )
objShell.Run "explorer c:\data\test\" & hostname & "\tools"
Set objShell = CreateObject("WScript.Shel
hostname = objShell.ExpandEnvironment
objShell.Run "explorer c:\data\test\" & hostname & "\tools"