how to run .bat file in powershell ???

Kottam Mahesh 1 Reputation point
2022-09-24T11:06:30.8+00:00

i am unable run infacmd.bat file in powershell

tried using start process
tried cmd
tried powershell.exe

can anyone ping me ,please

Thanks,
Mahesh

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,399 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 45,111 Reputation points
    2022-09-24T14:21:51.7+00:00

    Is the file "infacmd.bat" in your working directory? If so, and you're trying to run the file from PowerShell, try this: .\infacmd.bat.

    If the file's in some other directory, try this: X:\directoryname\infacmd.bat.

    1 person found this answer helpful.
    0 comments No comments

  2. JimmySalian-2011 41,926 Reputation points
    2022-09-24T11:39:10.27+00:00

    Hi Mahesh,

    Try this link and steps to run the bat file using PS, you will need to lower the security settings to allow execution.

    allow-others-to-run-your-powershell-scripts-from-a-batch-file-they-will-love-you-for-it

    ==
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  3. Limitless Technology 43,991 Reputation points
    2022-09-28T07:33:26.1+00:00

    Hello Maheshkottam,

    The command infacmd.bat belong to a product suite called Informatica PowerCenter that is a separate software out of Microsoft. You should post your question in their community or forums in order to get proper information that depends on the way that the software was developed independently of Powershell or CMD. Also their community would be better experienced in similar situations.

    --------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--