Share via

How to hide the windows of bat files and ps1 files when running.

Anonymous
2023-11-12T07:20:33.21+00:00

I want to hide the windows when the bat file and ps1 file are running

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

3 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 23,605 Reputation points
    2023-11-15T01:43:36.19+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    I'd try using the START utility.

    https://ss64.com/nt/start.html

    It will start a program, command or batch script that opens in a new/separate Command Prompt window. This allows the batch's cmd window to exit in the background.

    START powershell -file "D:\scripts\Powershell\xxx.ps1"

    And take care of common problems with double quote:

    https://stackoverflow.com/questions/154075/using-the-start-command-with-parameters-passed-to-the-started-program

    Was this answer helpful?

    0 comments No comments

  2. Anonymous
    2023-11-12T10:57:07.9233333+00:00

    As indicated

    Was this answer helpful?

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.