Calling file inside script folder in PowerShell -


i have powershell script in \folder\ have exe trying execute \folder\files\

how can execute file without having specify whole path , use either current folder drill down files.

i trying use not working

start-process -filepath '.\files\setup.exe' -argumentlist "-s" -wait 

the $psscriptrootvariable see right if you're using powershell 3 or newer. in version 2 variable work within modules, , i'm not sure version 1 (before time.)

$psscriptroot gives path of directory in script saved (not full path including file name don't need worry splitting out.)

for specific example:

start-process -filepath "$psscriptroot\files\setup.exe" -argumentlist "-s" -wait 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -