Dec 14 2007

How to deal with long filenames in Windows Powershell

Welcome back!

Google Query: long filename and powershell 

I was working on a project the other day where I had to call a program from within Windows Powershell. This particular program needed command-line arguments and an input file when it was called. I wasn’t sure about the syntax of doing this in Powershell. After some Googling, I found the answer on the Microsoft Channel 9 Forums. The details are below.

-If you want to call a long filename in your Powershell script, the line looks similar to the one below (all on one line).
&'C:\Path\To\Your\Program.exe' -argument1 -argument2 'C:\Path\To\Your\Inputfile.txt'

That’s it! Once I got the proper syntax, my Powershell script ran my external program beautifully. Happy Coding!

Technorati Tags: , , ,

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

TAGS:

LEAVE A COMMENT

Subscribe Form

Subscribe to Blog

Sponsors

Recent Readers

JOIN MY COMMUNITY!
                  Computers Blogs - Blog Top Sites