Windows 10: Write a batch script to read list of db names to connect

Discus and support Write a batch script to read list of db names to connect in Windows 10 Installation and Upgrade to solve the problem; Hi, I hope someone can help me. I am new to batch scripting. I want to read a file that has database names and connect to each of them to get status.... Discussion in 'Windows 10 Installation and Upgrade' started by TK100P, Oct 20, 2018.

  1. TK100P Win User

    Write a batch script to read list of db names to connect


    Hi, I hope someone can help me. I am new to batch scripting. I want to read a file that has database names and connect to each of them to get status. I'd like to do this from cmd command. I really appreciate if I can get some help here.

    Thanks in advance.

    :)
     
    TK100P, Oct 20, 2018
    #1

  2. Batch File - Find Multiple Files From Multiple Locations


    Hi,

    I'm not new to Batch Files but i have a requirement that i can't seem to get my head around, I'm sure it must be simple'ish..

    I have 2 .txt files (Locations.txt | Files.txt)


    • Locations is a list of directories
    • Files is a list of file names

    I would like to write a Batch Script that would loop through each location in the Locations.txt for files names that match any in Files.txt

    I think i may need to write a for loop to cycle through the locations but then i'm not sure how i would pass the file names through for it to check for.

    Basically if it does find any of those file names in any of the location i would want it to echo a message.

    Regards,
    Jamie
     
    JDobbsy1987, Oct 20, 2018
    #2
  3. Writing batch files

    I haven't done any coding for a very long time and I am looking for a tutorial and command list for making a batch file in win10. All I can seem to find are videos or sites that tell you that you use notepad to save a file as a .bat with virtually no info
    on the actual programming/scripting. I know it'll all come back to me once I do one or two basic files, but I need a detailed refresher. Any suggestions?

    (Specifically, I need a program to replace lines in one text file with lines from a different text file.)
     
    CosmicCowboy, Oct 20, 2018
    #3
  4. Bentley12 Win User

    Write a batch script to read list of db names to connect

    Batch File to list files from two seperat networks

    Hello,

    I work in a factory where multiple PCs are on seperate VLANs. I need to view contents of a directory from one VLAN called "Admin" and compare it with individual directories from multiple PCs on another VLAN called "Shop" ("Shop" is not part of the Domain)

    I have created a VB script that will compare two txt files and report the diffences. So I am trying to create two text files from each VLAN using a batch file. The batch file will be ran from a PC with two network cards so it can see both VLANs.

    I can easily create the list from the "Admin" network using:
    dir /b \\Server\Share\ > Active.txt

    The "Shop" list is different. It needs a username and password. All Shop PCs have the same user name and password but I'm not sure how to structure the script to create a list from multiple PCs using a user name and password.
    If I open the folders from Windows and enter the credentials then a script like this will work:
    dir /b \\PC_Name1\Share > Programs.txt
    dir /b \\PC_Name2\Share >> Programs.txt

    Using the command above without first opening the folder and entering the credentials gives this error: Logon failure: unknown user name or bad password

    Thanks in advance for any help.
     
    Bentley12, Oct 20, 2018
    #4
Thema:

Write a batch script to read list of db names to connect

Loading...
  1. Write a batch script to read list of db names to connect - Similar Threads - Write batch script

  2. Batch Script Adding a Period . to File Name

    in Windows 10 Gaming
    Batch Script Adding a Period . to File Name: Hi, I am testing a script to find the last file within a folder.It can locate the correct file, but the resulting variable includes a period . within the file name.Here's the script:REM Copy the recent Friday evening's Diff Backup onto the drive G: My Passport device.@echo...
  3. Batch Script Adding a Period . to File Name

    in Windows 10 Software and Apps
    Batch Script Adding a Period . to File Name: Hi, I am testing a script to find the last file within a folder.It can locate the correct file, but the resulting variable includes a period . within the file name.Here's the script:REM Copy the recent Friday evening's Diff Backup onto the drive G: My Passport device.@echo...
  4. Need help on batch script to shutdown computers from list

    in Windows 10 Gaming
    Need help on batch script to shutdown computers from list: Hi, I would need help to write a bat file to shutdown all the computers listed in the text file. Can someone help me please?This script will extract the list of computers name from the text file and loop to shutdown each computer....
  5. Batch scripting

    in Windows 10 Software and Apps
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  6. Batch scripting

    in Windows 10 Gaming
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  7. Batch scripting

    in Windows 10 Network and Sharing
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press any key. echo Before...
  8. Writing Script

    in Windows 10 Drivers and Hardware
    Writing Script: Hello, Could anyone write a script that would force automatic download and installation of drivers via Windows update? I care that you do not have to click Windows Update in the GUI, only that after calling the script it will download if there are any missing 175617
  9. Netfix Batch Script- Fix internet connection

    in Windows 10 Network and Sharing
    Netfix Batch Script- Fix internet connection: Somebody please try my batch script Netfix and leave feedback so I can improve it. thank you! My goal is to make a troubleshooter to help the built in "Windows Network Diagnostics" fix internet connection problems. How can you help? 1. Download/copy the code on notepad...
  10. Help needed writing batch script!

    in Windows 10 Support
    Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...