Little help with Batch. D:

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
61
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,003
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
61
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,003
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
61
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,003
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
61
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,003
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
797
Reaction score
537
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:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top