NameError on get_special_folder_path

1

I did a little test in Python 2.X to try to copy a file from the folder that the script is to the Windows startup folder:

import shutil
import sys, os

startuplocation = get_special_folder_path("CSIDL_STARTUP")
shutil.copy('fototest.jpg', startuplocation)

however, I get the message:

  

File "copytest.py", line 5, in       startuplocation = get_special_folder_path ("CSIDL_STARTUP") NameError: name 'get_special_folder_path' is not defined.

I started using Python very soon and I do not understand what's wrong.

    
asked by anonymous 03.01.2016 / 01:32

1 answer

2

Dear Pythonist friend, thank you for the language preference hehehe! Is this script you're doing for a post-installer?

Otherwise, the get_special_folder_path (csidl_string) function will not work! If you still want to find the StartUp location of your computer, use this script (if it is Windows):

import winshell
startup = winshell.startup()
    
03.01.2016 / 14:30