Execute Process Task Powershell : blank space in the path
- Hello :-)I have a problem with my Execute Process Task in SSIS.I did this:Executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeArguments: powershell -command "C:\Program Files\Microsoft SQL Server\100\DTS\Packages\SSIS-MY\myscript.ps1"Obviously, there is a problem due to space in the path because I got this error : "c:\program does not exit".So in CMD I tried this:C:\Users\user>powershell -command C:\'Program Files'\'Microsoft SQL Server'\10
0\DTS\Packages\SSIS-MY\myscript.ps1It works in CMD... but it does NOT work in SSIS.I tried this also: powershell -command "C:\'Program Files'\'Microsoft SQL Server'\10
0\DTS\Packages\SSIS-MY\myscript.ps1"What should I do? :-)Thanks!!
Question
Answers
- Hi,Please, replace the long path by its FAT 8.3 equivalent. Should be something similar to thispowershell -command C:\Progra~1\Micros~3\100\DTS\Packages\SSIS-MY\myscript.ps1How to obtain FAT 8.3 representation of your path?Open a DOS prompt, then execute the followingc:cd \Then execute dir /xIt'll show both the long NTFS and the short FAT 8.3 folder names.Look for Program Files and take note of its short FAT 8.3 name, something like Progra~1 or similar.Then executecd \Progra~1and run again dir /x to look for Microsoft SQL Server short representation (should something likeMicros~3 or Micros~2)Continue until you reached the file level.At the end, you'll have to whole FAT 8.3 representation of your file path.Use it on your script instead of c:\program files\microsoft sql server\...Bonne chance! Good luck!
Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu- Edited by Sebastian Sajaroff Tuesday, July 24, 2012 2:16 PM typo
- Marked as answer by MarDr Tuesday, July 24, 2012 2:28 PM
All replies
- Pass the same command through an parameter..
- build your arguments using expression and try validating the query. you might need to use escape characters for the path.
MCTS, MCITP: BI Technical Consultant| Karabina, South Africa Blog: www.selectsifiso.net - Try replacing c:\program files\microsoft sql server\100\dts\packages\ssis-my\myscript.ps1 by its corresponding FAT 8.3 equivalent.
Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu - OK. I tried to create an Argument in my task but I get this:TITRE : Microsoft Visual Studio
------------------------------
Nonfatal errors occurred while saving the package:
Error at Powershell - Project: L'expression contient le jeton non reconnu « powershell ». Si « powershell » est une variable, elle doit être exprimée sous la forme « @powershell ». Le jeton spécifié n'est pas valide. S'il représente un nom de variable, il doit comporter le symbole @ en préfixe.
Error at Powershell - Project: Échec de l'analyse de l'expression « powershell -command C:\Program Files\Microsoft SQL Server\100\DTS\Packages\SSIS-MY\myscript.ps1" ». Code d'erreur retourné : 0xC00470A4. Impossible d'analyser l'expression. Elle contient peut-être des éléments non valides ou n'est peut-être pas bien formée. Cela peut aussi se produire en raison d'une erreur de mémoire insuffisante.
Error at Powershell -Project: L'expression « powershell -command C:\Program Files\Microsoft SQL Server\100\DTS\Packages\SSIS-MY\myscript.ps1" » sur la propriété « Arguments » ne peut pas être évaluée. Modifiez l'expression pour qu'elle soit valide.Unfortunately it is in french. It is written "Echec reading expression "powershell -command" .
I never used the "Expression" tab... maybe did I do something wrong?thanks :-) - Error at Powershell - Project: L'expression contient le jeton non reconnu « powershell ». Si « powershell » est une variable, elle doit être exprimée sous la forme « @powershell ». Le jeton spécifié n'est pas valide. S'il représente un nom de variable, il doit comporter le symbole @ en préfixe.meansThe expression contains an unknown token "powershell". If "powershell" is a variable, then should be written as @powershell.Invalid token, should start with an @ symbol if representing a variable.Error at Powershell -Project: L'expression « powershell -command C:\Program Files\Microsoft SQL Server\100\DTS\Packages\SSIS-MY\myscript.ps1" » sur la propriété « Arguments » ne peut pas être évaluée. Modifiez l'expression pour qu'elle soit valide.meansString «powershell ...» on Arguments property can't be evaluated. Please correct it.Finally, "echec" means Failure.
Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu - Yeah Sebastian! :-)But in fact I am french so it was not a problem for me, I just wondered english people could not help me if they did not understand my error.It seems I can't write "powershell -command "path" " in an Expression to create Arguments.. I do not understand how this tab works.
- Hi,Please, replace the long path by its FAT 8.3 equivalent. Should be something similar to thispowershell -command C:\Progra~1\Micros~3\100\DTS\Packages\SSIS-MY\myscript.ps1How to obtain FAT 8.3 representation of your path?Open a DOS prompt, then execute the followingc:cd \Then execute dir /xIt'll show both the long NTFS and the short FAT 8.3 folder names.Look for Program Files and take note of its short FAT 8.3 name, something like Progra~1 or similar.Then executecd \Progra~1and run again dir /x to look for Microsoft SQL Server short representation (should something likeMicros~3 or Micros~2)Continue until you reached the file level.At the end, you'll have to whole FAT 8.3 representation of your file path.Use it on your script instead of c:\program files\microsoft sql server\...Bonne chance! Good luck!
Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu- Edited by Sebastian Sajaroff Tuesday, July 24, 2012 2:16 PM typo
- Marked as answer by MarDr Tuesday, July 24, 2012 2:28 PM
- yeah it works! I can run my Execute Process Task!It give me this path:powershell -command "C:\Progra~1\MI3EDC~1\100\DTS\Packages\SSIS-MY\myscript.ps1"Do you know if I move the SSIS package to another server it still will work? Or the short FAT 8.3 name change on each computers?
No comments:
Post a Comment