Find Jobs
Hire Freelancers

Batch file syntax error

$10-30 USD

Cancelled
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: 5166140

About the project

7 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
7 freelancers are bidding on average $27 USD for this job
User Avatar
Hello, With 99% completion rate, 650+ successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 !!)... you can never go wrong choosing me :) I look forward to your reply. Thanks. Kind Regards, Rajesh Soni
$45 USD in 0 day
5.0 (492 reviews)
7.4
7.4
User Avatar
Hi. I have great xp in cmd scripts. Would be glad to help you with this project. Regards, Yuri .
$35 USD in 2 days
4.9 (34 reviews)
4.5
4.5
User Avatar
hi, I can help you ----------------------------------------------------------------------------------------------------------------------
$30 USD in 1 day
5.0 (11 reviews)
3.9
3.9
User Avatar
Hello! I have identified and corrected several errors in your batch file. Basically, I can deliver you a corrected batch file within minutes after you award me the project and I accept it (please allow for time difference for initial contact). I have more than 20 years experience with PCs, going back to times of DOS when running batch files at command prompt were the only way one could automate things. I'm confident that I can do this job to your highest satisfaction. Best regards, Tom
$20 USD in 0 day
5.0 (2 reviews)
2.6
2.6
User Avatar
Hello. What exactly are you trying to get your for loop to do? And could you also send the error you receive? Thank you for your time and I look forward to working with you. Edit: Offhand I can see that you will most likely need to use either quotes "" around Program Files (x86) or use a short filename such as PROGRA~2 in your path.
$20 USD in 0 day
5.0 (1 review)
0.6
0.6
User Avatar
Will be done at 9:00 am gmt +1 thats exactly tomorrow morning. if you don't mind. Kind regards. Haris
$25 USD in 0 day
0.0 (0 reviews)
0.0
0.0
User Avatar
10+ years IT experienced professional. will complete within short time period with best service and satisfaction guaranteed.
$15 USD in 1 day
0.0 (0 reviews)
0.0
0.0

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.