can a command line action as batch file


  1. Posts : 75
    windows 10
       #1

    can a command line action as batch file


    I have a run a action on one of my programs to disable it (when required) quite regularly from an elevated cmd prompt...
    Can it be made into a bath file (.bat) and executed as and when required?
      My Computer


  2. Posts : 17,001
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    Yes.

    Denis
      My Computer


  3. Posts : 75
    windows 10
    Thread Starter
       #3

    Thank you Try3
      My Computer


  4. Posts : 18,034
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #4

    Hello @perfection,

    perfection said:
    I have to run an action on one of my programs to disable it (when required) quite regularly from an elevated cmd prompt...

    Can it be made into a bath file (.bat) and executed as and when required?

    Yes. The easiest way would probably be to create the .bat file on your Desktop, and then run it as and when required.

    I hope this helps.
    Last edited by Paul Black; 16 Feb 2021 at 11:09.
      My Computer


  5. Posts : 7,606
    Windows 10 Home 20H2
       #5

    The OP may create an elevated desktop shortcut to run the batch file.

    How to Add Create Elevated Shortcut to New Context Menu in Windows 10

    It works with apps and CMD/batch scripts.
      My Computer


  6. Posts : 75
    windows 10
    Thread Starter
       #6

    Have i to merely place the command line with switches in a text file and save as bat? or is there more to it?
      My Computer


  7. Posts : 7,606
    Windows 10 Home 20H2
       #7

    Please post the commands to be run.
      My Computer


  8. Posts : 456
    Windows 10
       #8

    Yes, you only have to put the command in a text file and save it with .bat extension instead of .txt
    A batch file is just a list of command lines that are run line by line.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 19:08.
Find Us




Windows 10 Forums