Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 228505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:41:16+00:00 2026-05-11T19:41:16+00:00

I need to have a batch file that copies files (8) in my local

  • 0

I need to have a batch file that copies files (8) in my local directory to either a list of machines on the network (hostname or IP) or have me prompt to enter the next hostname/ip

I’d prefer not to have to run the script over and over again to enter the next hostname/ip

I’ll also need to see the output for each system to make sure it connected correctly and copied successfully. Perhaps a “ready to process next?” after each machine?

I don’t know how to have a batch file does the equivalent of STDIN, so please forgive the ?STDIN? placeholder

So far, all I have is

net use S: \\?STDIN?\C$ /user:domain\myusername mypassword  

copy %~file01.txt S:\%SystemRoot%\system32 /y
copy %~file02.txt S:\%SystemRoot%\system32 /y
copy %~file03.txt S:\%SystemRoot%\system32 /y
copy %~file04.txt S:\%SystemRoot%\system32 /y
copy %~file05.txt S:\%SystemRoot%\system32 /y
copy %~file06.txt S:\%SystemRoot%\system32 /y
copy %~file07.txt S:\%SystemRoot%\system32 /y
copy %~file08.txt S:\%SystemRoot%\system32 /y

net use :s /delete

do it again
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:41:16+00:00Added an answer on May 11, 2026 at 7:41 pm

    You can prompt the user for input (and store it into an environment variable) with the set /p command:

    set /p HOST=Machine?
    net use S: \\%HOST%\C$ ...
    

    You can loop by using a label and jump to it. You should offer a way to exit, though:

    :loop
    set /p HOST=Machine? (leave blank to exit)
    if [%HOST%]==[] goto :EOF
    net use S: \\%HOST%\C$ ...
    copy ...
    ...
    goto loop
    

    If you don’t want to enter each host name individually you can also loop over the arguments to the batch file:

    :loop
    if [%1]==[] goto :EOF
    net use S: \\%1\C$ ...
    copy ...
    ...
    shift
    goto loop
    

    You can can call it as follows, then:

    my_batch machine1 machine2 192.168.12.14 ...
    

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a batch file that I need to run within my NSIS installer.
I have a batch file in DOS that does some checking and I need
I have a list of file names of files i need to delete. Is
I need to modify batch file. I have a batch file that opens many
I have a batch file that automates copying a bunch of files from one
I have two .exe file and 3 windows batch files and i need to
I need to copy multiple files in a single batch file. The files have
I have a few batch files I need to run frequently in developing a
I need a batch file that will recursively remove all directories with a certain
I have a batch file that creates a scheduled task using schtasks like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.