Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
63
First Language
English
Primarily Uses
RMMV
Does anyone here know how to work with Batch Files? (.bat)

I know how to code it semi-well but there is one problem I can't figure out.



I am making a custom Mod/Auto Patcher for an Online Game (also future RPGMaker Games)
and I want to find the current directory to copy/replace custom files over the original.

This is how I have it setup as of now.
 

xcopy /y "C:\Users\%USERNAME%\Desktop\Game Mod 1.4\Original Backup Files\Music" "C:\MMO Folder\MMO Game Folder\Music" >nulThe problem is, some users don't use C:\ as their installation drives, I am trying to figure out how to set it up to locate and find the installation folder.

I tried replacing C:\ with %CD% but that doesn't seem to work.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
well, you need to be saving where the user installs the files so you can get it back later... most programs write it into the registry


You can also maybe try to find a specific file in the installation to determine where the whole installation is...
 
Last edited by a moderator:

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
63
First Language
English
Primarily Uses
RMMV
well, you need to be saving where the user installs the files so you can get it back later... most programs write it into the registry

You can also maybe try to find a specific file in the installation to determine where the whole installation is...
That's the problem right there.

The mmo I play, for some reason some people have the game installed in their D:\ while some have it installed on their C:\

What I'm trying to figure out is how to LOCATE which drive they have their game installed in, then my program will find that folder and (for now) patch Custom music.

I also have a setup to patch the original files back quicker to.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
well, it probably wrote it in the registry to it's worth checking it out (I think you have it installed too, so you can verify this yourself)... you just need to know how to fetch registry info and the exact key used by the game
 
Last edited by a moderator:

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
63
First Language
English
Primarily Uses
RMMV
well, it probably wrote it in the registry to it's worth checking it out (I think you have it installed too, so you can verify this yourself)... you just need to know how to fetch registry info and the exact key used by the game
What exactly do you mean it probably wrote it in the registry ?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
Normally, installers write up the installation paths into the windows registry...


normally in either HKEY_CURRENT_USER -> SOFTWARE -> Company/GameName -> more subfolders


or HKEY_LOCAL_MACHINE -> SOFTWARE -> Company/GameName -> more subfolders


for example, the RTP install path is saved in


HKEY_LOCAL_MACHINE -> SOFTWARE -> ENTERBRAIN -> RGSS3 -> RTP (The path is up to here) -> RPGVXAce (the subkey)
 
Last edited by a moderator:

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
63
First Language
English
Primarily Uses
RMMV
I been messing around with Batch.
I can't seem to make it access Regedit related stuff.

There has to be another way to locate a folder on someone's PC/Directory. x.X
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
then maybe you could really run a search for one of the files in that folder... assuming they don't rename it...

or use other methods than a batch file...
 
Last edited by a moderator:

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
811
Reaction score
559
First Language
Portuguese
Primarily Uses
RMMV
%~dp0 Gives you the absolute path to the directory of the batch file
%cd% Gives you the current working directory (which isn't necessarily the directory of the batch file: you could have started it through a shortcut somewhere else, through a cmd prompt rooted in a different folder, etc.)

See: http://stackoverflow.com/questions/4419868/what-is-the-current-directory-in-a-batch-file

If you're running the batch file from some other folder and want to find out where the installation folder is, then yeah, you need to mess with registry keys. Alternatively, you can just have people install your patcher in the game's installation folder.
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

having anxiety during all this virus stuff is the absolute worst. I'm the only one missing out on my friend's wedding in Sept. because I can't be in large groups of people anymore due to anxiety.
Well... I just spent most of the day making something I cant even use xD

Hero_1.png
The idea was to look at the original but at a medium distance.
In hindsight, I might as well have just edited the original lol... I didn't intend for it to end up so similar.
does anyone else feel tired after completing a sprite?
Fun fact: I always lower every tileset saturation (about 15%-25% of it) in my projects.

Forum statistics

Threads
113,903
Messages
1,078,318
Members
148,004
Latest member
doctor-squared
Top