Jump to content

How to change the default save location for temporary files


Recommended Posts

Dear AutoIt User Community,

I am Sam and this is my first post here. I hope to learn lots from AutoIt. I have just started using AutoIt and love it, so far I have just been doing a little bit of Java programming alongside a lot of HTML, CSS and JS programming. Basically I am not a noob to computers but totally new to AutoIt. I have an old box with XP SP2 on it and use it quite happily. Anything else you like to know, ask me.

A little while ago I started using a AutoIt script that rips and encodes CDs to various file formats and then saves them to a chosen location. However the temporary directory for the ripped files is always the system default "My Music" folder. I would like to be able to change this location to either C:\ or C:\Temporary Music\ or even D:\Music.

I think the line in the script that sets the default temporary folder location is this:

Global $g_myMusicDir = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "My Music")

I have tried simply changing this to another location by doing this:

Global $g_myMusicDir = "D:\Music"

but the change does not have any effect on the script at all and the temporary files are saved in the XP default "My Music" folder. Now of course I can change the default location of that on XP with Tweak UI XP Powertoy but I don't want to do that, I prefer to change the script to my liking instead of the computer it works on.

How can this be done? Can someone please point me in the right direction as to "where to look" or "where to find the information"? I have had a look at the documentation but am too new to make use of it for this particular purpose I find. I would kind of prefer to learn about this before I go through all the tutorials and read all of the documentation. Basically I am not asking for the solution, but if someone has it or can help me find it, that of course would be very much appreciated.

I have also been in touch with the dev of the script but unfortunately he does not reply to my PMs and seems to be quite busy otherwise.

The whole program consists of several .au3 files but the above line of code only shows up in two of them. So I think perhaps changing those two lines of code accordingly in those two .au3 files will actually enable me to have the temporary files in a folder of my choice. What do you think? Can this be done and it is easy or will I need in depth knowledge of AutoIt and perhaps other languages to accomplish this task?

Thanks for any help or tips on this. Much appreciated.

Sam :)

Link to comment
Share on other sites

Hi Sam,

Welcome to the forums!! :D

Try replacing that line, just as you have, in both files :)

I haven't yet taken a close look at that source but it should do the trick.

If it doesn't, post back and I'll see what I can do ;)

Take a look at the Wiki and help-file when you're ready to dive into coding.

Good luck ;)

-smartee

Link to comment
Share on other sites

Hello Smartee,

thanks for your reply. I had another deeper look and it turns out that the original software that the mod is made for has some sort of internal memory that triggers the default "My Music" path on certain actions, like if "copy" etc. is selected from the main menu. Because of that the changes in the scripts do not affect the end result with regards to the temporary folder location.

Basically values are being passed between the original software and the mod I think and as the original software is not open source there is no way for me to make changes to it that then would also work with the scripts. However there is a way of setting another configuration file to the directory the user likes, this has to be done manually though, but just once before starting the actual ripping and encoding process.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...