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

  • Home
  • SEARCH
  • 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 859231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:39:11+00:00 2026-05-15T08:39:11+00:00

I am trying to use a copy command for Windows and we have directories

  • 0

I am trying to use a copy command for Windows and we have directories such as c:\oracle.

While trying to execute one such, we get the following error:

source_file=folder+"\"
                          ^
SyntaxError: Lexical error at line 17, column 23.  Encountered: "\r" (13), after : ""

Here folder is my path of c:\oracle and while trying to add file to it like:

source=folder+"\"+src_file

I am not able to do so. Any suggestion on how to solve this issue?

I tried with / but my copy windows calling source in os.command is getting "the syntax is incorrect" and the only way to solve it is to use \ but I am getting the above error in doing so.

Please suggest. Thanks for your help

Thanks.

  • 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-15T08:39:12+00:00Added an answer on May 15, 2026 at 8:39 am

    Short answer:

    You need:

    source_file = folder + "\\" + src_file
    

    Long answer:

    The problem with

    source_file = folder + "\" + src_file
    

    is that \ is the escape character. What it’s doing in this particular case is escaping the " so that it’s treated as a character of the string rather than the string terminator, similar to:

    source_file = folder + "X + src_file
    

    which would have the same problem.

    In other words, you’re trying to construct a string consisting of ", some other text and the end of line (\r, the carriage return character). That’s where your error is coming from:

    Encountered: "\r" (13)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the scp command but I'm getting the following error:
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I have the following code to copy files sprintf(command, copy /Y %s %s, sourceFile,
I'm trying to use ANT to copy files from one directory to another directory
I normally use scp to copy stuff, but now I'm trying to get used
I'm trying to use Runtime.exec to start a copy of the current process. I
I am trying to copy files from a directory that is in constant use
I am trying use gem tire to search in my application. I have tables
Hi I'm trying use a datepicker on a field I have. I'm trying to
Hi I'm trying to use robocopy to copy a single file from my computer

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.