0

I have a Powershell script which converts a CSV file to Excel, however I want to create a Batch file to execute that Powershell script. When I try to I get an error message:

error processing aurguments. there is no option with the following name: execution policy.
Syntax
powershell_ise.exe[[-File] <listoffiles>][-Help]-[MTA][-Noprofile]

The Batch file script is:

@echo off
Powershell_ise.exe -executionpolicy remotesigned -File  C:\Users\siddhary\Desktop\csv_to_xlsx .ps1

however when I open the Powershell_ise.exe, then open the script from desktop & run, it runs succesfully. But when I try to do it with a batch file I get the above error message. Please help.

1

2 Answers 2

1

The error message is telling you exactly what's wrong. Powershell_ise.exe does not accept an -executionpolicy parameter. You can verify this yourself by running:

powershell_ise.exe /?
Sign up to request clarification or add additional context in comments.

Comments

0

Change your call from powershell_ise.exe to powershell.exe

@echo off
Powershell.exe -executionpolicy remotesigned -File  C:\Users\siddhary\Desktop\csv_to_xlsx .ps1

Here's the reference to using powershell_ise.exe, and here's powershell.exe

1 Comment

You have used the _ise version in your example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.