How to Create a file in "my documents" folder?

Let’s learn how to Create a file in "my documents" folder. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

Finding the user's "My Documents" path

Alright so I have this small program and it needs to create a small .txt file in their 'My Documents' Folder. Here's the code thing for that: textfile=open('C:\Users\MYNAME\Documents','w') lines=['stuff goes here'] textfile.writelines(lines) textfile.close() The problem is that if other people uses it, how do i change the 'MYNAME' to their account name? Sorry if I'm not so clear on my question.

Answer:

Use os.path.expanduser(path), see http://docs.python.org/library/os.path.html e.g. expanduser('~/filename...

Read more

Firetryer at Stack Overflow Mark as irrelevant Undo

Other solutions

Outputting a hyperlinked list of documents in a folder with relative filepaths in Excel 97

So I am stuck at work with Excel 97. I am trying to do something that seems simple enough in my head but just isn't. Basically, I have a workbook filled with a bunch of worksheets. In some of those worksheets, I would a list of documents in a given folder...

Answer:

I don't think VBA has changed all that much. The following works on my (current) office setup. I'd mostly...

Read more

neksys at Ask.Metafilter.Com Mark as irrelevant Undo

How to recover data in a Windows encrypted file/folder ?

I encrypted a folder in Windows XP. Then I formatted my C:\ but managed to back up its contents. I've since restored most of the old C:\ into the new C:\ and have deleted all the folders including the old Windows folder. I've only still got the previous...

Answer:

The key pair consits of the Security IDentifier for the user account that created the encrypted files...

Read more

danteliv... at Yahoo! Answers Mark as irrelevant Undo

Can create a new folder BUT CANT RENAME HELP!?

i can create a new folder but when i try to rename it says the "the file or folder does not exist?" i can still enter the folder make new documents etc.. but i can't rename it or it doesn't exist. is their something wrong with my registry?...

Answer:

I don't use PCs that often so I don't know if this will work but click on the name of the folder until...

Read more

tapetum lucidum at Yahoo! Answers Mark as irrelevant Undo

The My Documents folder redirection in Windows 7?

I'm having a problem redirecting user's My Documents folder using gpmc (Windows Server 2008 R2 Standard) for Windows 7 Clients. I choose the Basic settings "Redirect everyone's folder to the same location" and target folder location is set...

Answer:

the computer name has to be spot on , and the link is usually something like file:\\\\\FILESERVER\home...

Read more

racecar at Yahoo! Answers Mark as irrelevant Undo

Can't Create a New Folder in Pictures Library (Windows 7)?

I've got Windows 7 and while organizing photos I tried to create a new folder without success. This is in the Library called Pictures (in the Documents folder): The first thing I noticed was that there wasn't a "new folder" button. So, then...

Answer:

Hi, you cannot create anything in Library except another library .you have to make folder in inside...

Read more

David S at Yahoo! Answers Mark as irrelevant Undo

How to create a computer file?

You know like when you buy your laptop and there it is, the My Music, My Pictures, My Videos, My Documents and all ? I want to create a new file "My Photos" and I want it to be like that. But when I create a new folder, it's not like the real...

Answer:

Go to Libraries and at the top you will see the option to 'create new library' :] Like this.... http...

Read more

Anchovy at Yahoo! Answers Mark as irrelevant Undo

Batch file to create a folder?

Hi! I'm new to using batch file.. I would like to create a new folder with the name, for example; If the folder "01" already exists and the current date is "01", do not create any folder. If the folder "01" already exists...

Answer:

@echo off setlocal enabledelayedexpansion cd %~dp0 set currentDate=%date:~7,2% if not exist %CurrentDate...

Read more

caine hammers at Yahoo! Answers Mark as irrelevant Undo

How can I create a folder and move a file from the current folder to the new folder using a shell script?

I want to move img/file.jpg to img/logo/file.jpg, and I need to create the logo folder.

Answer:

The mv manpage shows mv will accept multiple arguments. The last argument is the directory; all others...

Read more

Darren Higgins at Quora Mark as irrelevant Undo

What is the best version control solution for a folder of a variety of file types like documents and pictures?

Background: I am macosx Lion user and I often work with a folder with lots of word/pages documents including legal documents, business plan, contracts and even some jpg/png pictures needed for documents, all of these files may be edited or changed over...

Answer:

Personally I prefer GIT for all sorts of projects. SVN would be the other solution I guess.

Read more

Milo at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.