Find Jobs
Hire Freelancers

Batch file syntax error - repost

$10-30 USD

Completed
Posted over 10 years ago

$10-30 USD

Paid on delivery
I wrote this batch file and I am trying to get it to run in cmd prompt but I keep getting a syntax error on the FOR loop. I just want to copy files to computers on my network. Here is the code for the batch file. The complist file contains PC1 PC2 PC3 What is wrong? set FILE2COPY = C:\test1\[login to view URL] set COMPLIST = C:\test1\[login to view URL] for /f %%a in ("%COMPLIST%") do ( set WIN7 = \\%%a\c$\Program Files (x86)\test1 set WINXP = \\%%a\c$\1test if EXIST "%WIN7%" (set COPYDIR =%WIN7% ) else ( if EXIST "%WINXP%" ( set COPYDIR =%WINXP% ) else ( ECHO No such directory exists for computer %%a pause GOTO :END ) ) copy "%FILE2COPY%" "%COPYDIR%" /Y ) Pause :END
Project ID: 5166154

About the project

2 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I also use batch scripts in doing data back up in our company all the time. I wrote a lot of program using it. Im sure I can fix the error on your code. So what your trying to do is copy the file "[login to view URL]" and put it into PC1, PC2, PC3 programfiles\test folder. I can get it done. let me know if your interested.
$30 USD in 3 days
5.0 (3 reviews)
1.9
1.9
2 freelancers are bidding on average $30 USD for this job
User Avatar
hi, I can help -----------------------------------------------------------------------------------------------------------------------------
$30 USD in 1 day
5.0 (11 reviews)
3.9
3.9

About the client

Flag of UNITED STATES
flagstaff, United States
5.0
1
Member since Jul 5, 2012

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.