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 8491485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:26:19+00:00 2026-06-10T22:26:19+00:00

I am currently working on a script that does some things to Windows directories

  • 0

I am currently working on a script that does some things to Windows directories and I can’t seem to figure out what I am doing wrong. Here is the relevant excerpt of the code.

    import os
    user = os.environ['USERNAME']
    os.chdir("/users/%s/dekstop") % user

But when I do that, it gives the the following error,

WindowsError: [Error 3] The system cannot find the path specified: '/users/%s/desktop'

Is there a reason why the string formatting wouldn’t be working?

  • 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-06-10T22:26:20+00:00Added an answer on June 10, 2026 at 10:26 pm

    The % users should be within the parentheses:

    os.chdir("/users/%s/dekstop" % user)

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

Sidebar

Related Questions

I am currently working on a web add-on that does certain things depending on
I'm currently working on a PHP/MySQL script that does the following, in this order:
I'm currently working on a jQuery script that will translate the site's text into
I'm currently working on some R&D for improving the process and practice that we
I'm currently working on a small script that needs to use gtk.StatusIcon() . For
I have a perl script that will perform some operations on directories, and I
I`m currently working on a script, and I have the following situation. function somnicefunction()
I'm currently working on a script which should analyze a dataset based on a
I'm currently working on a PowerShell script to analyse VPN traffic by reading the
We currently have a working php mail script, this works fine and as we

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.