Jump to content
Sign in to follow this  
Draygoes

DirCopy not working. I wish to copy my PaleMoon profile.

Recommended Posts

Draygoes

As stated, I want to automate copying the profile, as I am working on a full Sync system using dropbox, and a bit of code. I know what needs to be  done by hand for this to work, but I would like to automate as much as I can.

Right now though, I am having trouble getting dircopy to work.

:Code Below:

#include <FileConstants.au3>
If ProcessExists( "palemoon.exe" ) Then
    MsgBox( 0, "Problem", "Palemoon is currently running. Please close it and try again." )
    Exit
EndIf
$profile = "C:\Users\Administrator\AppData\Roaming\Moonchild Productions\Pale Moon\Profiles\tt84i0zg.default"
DirCopy($profile, "\profile" )

 

Thank you in advance for your time.


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites
Maelstrom

Dircopy tends to be glitchy.  If I were you I would use FilesToArray.

Share this post


Link to post
Share on other sites
Draygoes

The last line DirCopy($profile, "profile" ) copies the profile's content into the profile folder.

Replace profile by a full path

I thought that by adding profile would cause the script to understand that I want it to use its directory as the root. I will change it and see if it works though.


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites
Jos

I thought that by adding profile would cause the script to understand that I want it to use its directory as the root

 ... then it should read: "Profile".

"profile" means it will go to "Drive:Profile"

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Draygoes

Well, I corrected the script with full path added, and it still does nothing.

#include <FileConstants.au3>
If ProcessExists( "palemoon.exe" ) Then
    MsgBox( 0, "Problem", "Palemoon is currently running. Please close it and try again." )
    Exit
EndIf
DirCopy("C:\Users\Administrator\AppData\Roaming\Moonchild Productions\Pale Moon\Profiles\tt84i0zg.default\", "C:\Users\Administrator\Desktop\PaleMoon Sync\profile" )

Once I can get this basic thing working, the rest of the project will be cake. I am automating the process because I am tired of having to do all of this by hand. Grab folder, add to drop box, go to other machine, delete a couple of files from the profile that I am about to plant, erase the profile for the other browser, and copy this over.
The solution I have in mind is basicly a 2 click solution, which I will be testing on a VM before ever using on my main machine.

Also, I should note that I have never used an array before... for anything. So I would have no idea how that would work.

Edited by Draygoes

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites
bordomavi

#include <FileConstants.au3>
If ProcessExists( "palemoon.exe" ) Then
    If MsgBox(0x24, "Problem", "Palemoon is currently running. Do you want close and continue?") = 6 Then
        DirCopy(@AppDataDir & "\Moonchild Productions\Pale Moon\Profiles\tt84i0zg.default\", @DesktopDir & "\PaleMoon Sync\profile", 9)
    Else
        Exit
    EndIf
Else
    DirCopy(@AppDataDir & "\Moonchild Productions\Pale Moon\Profiles\tt84i0zg.default\", @DesktopDir & "\PaleMoon Sync\profile", 9)
EndIf

how about this?

  • Like 1

Share this post


Link to post
Share on other sites
Draygoes

That worked perfectly. I was getting ready to just use a batch script to do this lol.

Thank you all for your help! :thumbsup:


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites
Draygoes

Project is completed. Basicly, the script to install the backup file is just the one above but in reverse, and it deletes the old profile first. It all works perfectly!!! :thumbsup:

Oh, and I have it backup to my dropbox folder.

If anyone else wants to do this, then there is one more thing that I did that works. I changed the profile name in "profiles.ini" so that it matches on both computers. This way it can go forward and reverse any time I want it to.


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
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
Sign in to follow this  

×