utuser12 Posted February 19, 2014 Report Share Posted February 19, 2014 Hi I'm trying to get a script running when a state changes. I have some trouble with powershell and spaces in the directory. I know this have been discussed some time now. But i have some strange behavior:: powershell -ExecutionPolicy Unrestricted -nologo -noprofile -noexit -file C:\script\Test-Args.ps1 "%D"Then i get the directory as one string with a " at the end. powershell -ExecutionPolicy Unrestricted -nologo -noprofile -noexit -file C:\script\Test-Args.ps1 "%DThen i get the directory as one string. powershell -ExecutionPolicy Unrestricted -nologo -noprofile -noexit -file C:\script\Test-Args.ps1 "%D "%NThen i get the directory and Name as one long string powershell -ExecutionPolicy Unrestricted -nologo -noprofile -noexit -file C:\script\Test-Args.ps1 %DThen i get a string for every space. powershell -ExecutionPolicy Unrestricted -nologo -noprofile -noexit -file C:\script\Test-Args.ps1 "%D;%S;%NI get one long string spaced by ;, this is what im using now as i can split it in powershell. But does anyone know why this strange behavior occurs? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.