open csv file as excel by using command prompt

I have to open csv file after creating from Powerbuilder.
Upon creating csv file , I have to open csv file as excel file automatically.

So I think it is better to use command prompt.
How could I open csv file as excel by using command prompt?
Sat NunaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


pls try something like

"c:\program files\microsoft office\office12\excel.exe" "c:\newfile.csv" 

Open in new window

Adjust the path of Excel accordingly

Derek SouterITO Svc Delivery Cons IIICommented:
if i have a file called examples.csv in a folder called downloads on my E: drive - so the path to the file is e:\downloads\examples.csv.   I simply need to call excel.exe and provide the filename path at  the end

so, assuming  that the PATH variable does not already include the path to the Excel exe file, I would need to put in "c:\program files (x86)\microsoft office\office15\excel.exe" to launch Excel (2013)

to launch excel and open the CSV file, I would simply type this command (you need the quotations because of the spaces in the folder path)

"c:\program files (x86)\Microsoft Office\Office15\Excel.exe" e:\downloads\examples.csv
Sat NunaAuthor Commented:
The path written for location at installed excel seems it depends on where you installed office and what version installed.
So I think if I use this command, I should have located the installed path before.
Can't I use other way or can I locate the path simply by using command prompt or powerbuilder?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Derek SouterITO Svc Delivery Cons IIICommented:
you could use additional commands to find the excel.exe file, and then build that into the path - however that is a bit more complex.

much easier to accomplish in VBS

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = TRUE
Set objWorkbook = objExcel.Workbooks.Open("e:\downloads\examples.csv")

Open in new window

Sat NunaAuthor Commented:
Than you for your help.
It worked!
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
If the default operation for CSV is to open them in Excel, just calling the CSV file will do.
Usually Office is in PATH, and you can use start excel c:\folder\file.csv.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sat NunaAuthor Commented:
Than you for your solution.
It rather simple than vbs and worlk any pc.
Sat NunaAuthor Commented:
Yes your solution is best . But I don't know how to change accepted comment.
Sat NunaAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.