Jump to content

Recommended Posts

Posted (edited)

ok...here is my setup.

these files are on the root of my c: drive pc.txt, code.bat, run.bat

(pc.txt)

\\pc1\c$

\\pc2\c$

(code.bat)

md install

(run.bat)

For /f "tokens=1,2" %%a in (c:\pc.txt) do call code.bat

so basically

1. pc.txt which contains all my puters on my network.

2. code.bat is what i want to "execute" on the puters

3. run.bat can be executed manually or through scheduled tasks from my puter or a server ect....

i'm kinda new learing the "for" command...and can see that it does allot...hehe

any input to what i have wrong here?

thanks

Edited by net_user

Posted

You are nearly there

For /f %%a in (c:\pc.txt) do call code.bat %%a
This will input %%a into code.bat as a parameter %1

Therefore your code.bat should look something like this:

md %1\install

This would then run the following

md \\pc1\c$\install
md \\pc2\c$\install

Hope this helps

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...