Windows 10: Starting batch file only opens command prompt versus running the batch file?

Discus and support Starting batch file only opens command prompt versus running the batch file? in Windows 10 Software and Apps to solve the problem; I'm trying to run one batch file, then another. Instead of running the 2nd batch file, it just opens another black screened command prompt with the... Discussion in 'Windows 10 Software and Apps' started by bobhamblin, Mar 14, 2023.

  1. Starting batch file only opens command prompt versus running the batch file?


    I'm trying to run one batch file, then another. Instead of running the 2nd batch file, it just opens another black screened command prompt with the name of the batch file as the first line in the command prompt? Any ideas why?

    :)
     
    bobhamblin, Mar 14, 2023
    #1

  2. Batch file

    thank you for your reply. how to merge the codes so that the batch file does this

    the batch file displays the options below

    1. open the *.spl file in notepad
    2. delete the *.shd and *.spl files
    3.exit

    commands execute as options are selected
     
    Sandeep Bhugoo, Mar 14, 2023
    #2
  3. Batch Files Knowledge Base

    Baiscly I'm making this thread so people can post what commands they know for batch files. I am curious and would like to know more about what can be done with batch files. I don't expect many people to know a lot, but I do expect a few people to know something.

    All I know is how to make a batch file that will open Command Prompt. All you have to do is make a new text file, insert something like "CMD" or "command.com" save it as (Anything).bat and you have yourself a batch file that now executes Command Prompt.

    So if anyone knows anything else, please share it on this thread pleaes.*Smile Starting batch file only  opens command prompt versus running the batch file? :)
     
    AphexDreamer, Mar 14, 2023
    #3
  4. Kreij Win User

    Starting batch file only opens command prompt versus running the batch file?

    Batch Files Knowledge Base

    Batch files are exactly that. They are a file that contain a "batch" of commands so that you do not have to type them consecutively at a DOS prompt.

    Anything that you can do at a DOS prompt you can do in a BF, and more.

    What batch files allow you to do is take arguments when you call the file using the % identifier within the batch file, and also to use conditional statements (if's) to cause code redirection based on user input.

    Batch file syntax is really easy to learn, and in a day or two you can write very powerful batch files to do a lot of stuff.

    They are not so much useful to the home user as they are to someone who is an administrator of a network.

    A simple use of a batch file ...

    Let's say that you have a system that has 3 hard drives. C:, D:, E:
    You want to copy the contents of C & D to E.

    You create a file called MyCopy.cmd (just make a text file in notepad and rename it)
    Then type in two lines.
    "xcopy C:\ E:\MyCopyOfC /c /e /r /k (etc. xcopy siwtches
    "xcopy D:\ E:\MyCopyOfD (switches)

    Save the file and run from a DOS prompt.

    This will create two directories (if the switches are correct) called MyCopyOfC and MyCopyOfD on the E: partition.

    This is a simple backup solution for multiple hard drives.

    You can , of course, get as elaborate as you want.
     
    Kreij, Mar 14, 2023
    #4
Thema:

Starting batch file only opens command prompt versus running the batch file?

Loading...
  1. Starting batch file only opens command prompt versus running the batch file? - Similar Threads - Starting batch file

  2. Batch File Command???

    in Windows 10 Gaming
    Batch File Command???: I want to run a batch file that starts a backup program, but does not execute the next command until that program completes? How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/batch-file-command/3af2ce6b-ace3-43cb-b6fb-5cbff8998736
  3. Batch File Command???

    in Windows 10 Software and Apps
    Batch File Command???: I want to run a batch file that starts a backup program, but does not execute the next command until that program completes? How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/batch-file-command/3af2ce6b-ace3-43cb-b6fb-5cbff8998736
  4. Starting batch file only opens command prompt versus running the batch file?

    in Windows 10 Gaming
    Starting batch file only opens command prompt versus running the batch file?: I'm trying to run one batch file, then another. Instead of running the 2nd batch file, it just opens another black screened command prompt with the name of the batch file as the first line in the command prompt? Any ideas why?...
  5. Batch File run but GUI not prompt

    in Windows 10 Gaming
    Batch File run but GUI not prompt: Hello,I made an batch file to run exe file but GUI prompt not appear if i tried to run from outside i.e. batch file present on ABC Folder and I am going to command prompt and run the same it's running and GUI Interface shows but when I runneed the file from other directory...
  6. Batch File run but GUI not prompt

    in Windows 10 Software and Apps
    Batch File run but GUI not prompt: Hello,I made an batch file to run exe file but GUI prompt not appear if i tried to run from outside i.e. batch file present on ABC Folder and I am going to command prompt and run the same it's running and GUI Interface shows but when I runneed the file from other directory...
  7. Command Prompt closes immediately after opening batch file

    in Windows 10 News
    Command Prompt closes immediately after opening batch file: [ATTACH]When we execute a batch file, the Command Prompt opens and closes automatically after processing the batch file. Sometimes, the command is executed so quickly that it seems like the Command Prompt closes immediately after opening the batch (BAT) file. This prevents...
  8. Command Prompt/ Batch files

    in Windows 10 Ask Insider
    Command Prompt/ Batch files: [ATTACH] when i create a batch file to ping something, it spams the command and throws no response. how do i fix this? https://preview.redd.it/fyy6qwrfx7n61.png?width=256&format=png&auto=webp&s=d55552fdc7a5c297d565617f710992048238660c submitted by /u/xWasss [link]...
  9. run a powershell command like a batch file

    in Windows 10 Installation and Upgrade
    run a powershell command like a batch file: I am working as a temp on a Windows 7 to Windows 10 migration team. We've encountered a problem with some software, and a solution has been found that requires us to execute a a single command with PowerShell. However, the command is extremely long and complex, and very...
  10. Running an uneditable Batch file

    in AntiVirus, Firewalls and System Security
    Running an uneditable Batch file: Hi people, Got a task to run a certain CMD command on a number of PCs as administrator. So I thought i would create a batch file doing this. This is not the issue. The issue is that I am unable to lock down successfully so people cannot just edit the file to see the admin...