Windows 10: Batch File Help

Discus and support Batch File Help in Windows 10 Software and Apps to solve the problem; I've never dabbled much in batch files, as I've usually been able to find pre-made ones to do what I wanted. We have an application that handles user... Discussion in 'Windows 10 Software and Apps' started by DeaconFrost, Aug 10, 2016.

  1. Batch File Help


    I've never dabbled much in batch files, as I've usually been able to find pre-made ones to do what I wanted. We have an application that handles user data backups. It has three services, and at times, one or two of the three don't start automatically. If you stop and start the services, all is well. I found a batch file template and edited to suit my needs, however, it sames to fail if a service is stopped already, and doesn't try to restart it.

    So, my question, is there a method to say if a service is running, stop it. If not, move along to the next line? I had assumed this would have happened by default, but it doesn't. Here is the start and stop lines in my file:

    net stop "Backup Agent"
    net stop "Backup Extender"
    net stop "Backup Updater"
    net start "Backup Agent"
    net start "Backup Extender"
    net start "Backup Updater"

    I would need some kind of "if" to go with the three net stop lines. Does something like that exist?

    :)
     
    DeaconFrost, Aug 10, 2016
    #1

  2. microsoft should make a store app for just batch files or vbs scripts and software

    so I was thinking people could make help full batch files that will help people so they do not have to do a lot of typing to fix their pc .

    We all know that batch files are very powerful scripts. SO if you can use the batch files and vbs to help others all the batch files should be free. This could help millions of people or get people to start making batch files to . I want this to happen .and
    apply the new store app so it comes through an update not get it from the store.
     
    PeterTjapkes, Aug 10, 2016
    #2
  3. ThreeTima Win User
    Batch Files?

    Ok... I would like to know if there is a way to creat batch files or a script to perform multiple commands.

    Examples would be:

    Something to delete specific file(s) (such as the contents of a cache directory or old log files) and then start a program.

    Please Help
     
    ThreeTima, Aug 10, 2016
    #3
  4. Batch File Help

    Actually it does that, make sure, that you run it as admin and add /y.

    net stop "Backup Agent" /y
    net stop "Backup Extender" /y
    net stop "Backup Updater" /y
    net start "Backup Agent"
    net start "Backup Extender"
    net start "Backup Updater"
     
    TairikuOkami, Aug 11, 2016
    #4
  5. Never occurred to me to check on switches for the net command. Thank you for the help, it worked perfectly.
     
    DeaconFrost, Apr 5, 2018
    #5
Thema:

Batch File Help

Loading...
  1. Batch File Help - Similar Threads - Batch File Help

  2. Help with batch files for a newbie.

    in Windows 10 Software and Apps
    Help with batch files for a newbie.: Hello and Happy New Year!I have a few files open upon log in to my windows account by using the shell:startup folder. This has been working well but I feel like instead of having to update this folder every week file names change every week due to having the date in their...
  3. Help with a batch file

    in Windows 10 Network and Sharing
    Help with a batch file: I got the batch file to delete Skype-Setup.exe in the specified folder, but then it keeps repeating. Apparently I am missing something in the command.I didn't see anything relevant in forfiles /?C:\WINDOWS\system32>forfiles /P "C:\Users\Robert Allen...
  4. Help with a batch file

    in Windows 10 Gaming
    Help with a batch file: I got the batch file to delete Skype-Setup.exe in the specified folder, but then it keeps repeating. Apparently I am missing something in the command.I didn't see anything relevant in forfiles /?C:\WINDOWS\system32>forfiles /P "C:\Users\Robert Allen...
  5. Help with a batch file

    in Windows 10 Software and Apps
    Help with a batch file: I got the batch file to delete Skype-Setup.exe in the specified folder, but then it keeps repeating. Apparently I am missing something in the command.I didn't see anything relevant in forfiles /?C:\WINDOWS\system32>forfiles /P "C:\Users\Robert Allen...
  6. Need help with batch file

    in Windows 10 Support
    Need help with batch file: Hi all, I need a batch file to do the following: If this is the first time the batch is run: Do command one If this is the second, third or fourth time the batch is run: Do command two If this is the fifth time the batch is run: Do command three Start all over again as if the...
  7. Batch File Help

    in Windows 10 Support
    Batch File Help: I'll be the first to say that I have never made a batch file. I've seen them and even ran them, but never made one. What I would like to do is at 9:00 P.M. copy files from one drive to another drive. And have this process repeat it's self daily. I know that I can put this...
  8. CMD Batch file help

    in Windows 10 Support
    CMD Batch file help: Hello, i am running into a issue i am trying to resolve but im getting nowhere and hopefully someone could help me. I'm simply trying to point a copy to parent or "grand"parent directory/folder. I tried ".." but it seems to come back the same message Code: The system cannot...
  9. Batch File help!

    in Windows 10 Ask Insider
    Batch File help!: I'm trying to run a batch file that scans the network for a set IP range. When I run the commands individually through command prompt they work just fine. I've saved the txt file as both a .cmd, and .bat. I've also ran both as administrator, as well as navigating to the...
  10. Need batch file help

    in Windows 10 Support
    Need batch file help: I want to create a script to start a game at E:\Grand Theft Auto V\PlayGTAV.exe and wait one minute and then open an existing batch file at E:\Grand Theft Auto V\GTAV Hardcore.bat What do I have to add to the following? start /b "" "E:\Grand Theft Auto V\PlayGTAV.exe" start...