1.

Solve : Batch File to move a file Help.?

Answer»

Good Morning,

I am trying to create an installer that my clients can run that will accomplish two objectives.

Objective 1: Add a line to their hosts file to redirect their program to my server. I have accomplished this objective through the use of the code below.

Objective 2: Is beyond my current capabilities. I need to move or copy a file that they downloaded along with the executable (a converted version of the Batch file that we are discussing) regardless of it's current location to a new location and overwrite the existing file that already exists.

Ideas?

Chad

Sounds like a hack or prank or virus. Possibly not, but there are serious security implications here. Modifying the Hosts file is usually disabled for non-administrator accounts for a good REASON. If you are an IT pro, how come you don''t know that? If you aren't an IT pro, why are you doing this?

After a PM exchange with the OP I'm unlocking the thread.Quote from: Allan on August 21, 2013, 12:19:09 PM

After a PM exchange with the OP I'm unlocking the thread.

Sorry Allen I don't see that I have the option to edit my OP. Please feel free to remove any harmful content at your discretion.

My goal is to help my players get their game pointed to my server. That has all been worked out. The problem I am having is that the server name is actually client side in a file servername.dat I have a servername.dat file for my players that will display my server name "Relentless" What I want to do is provide it along with the batch file I am working on and have the batch file overwrite the default servername.dat file with mine.

I think I can do it if they were to unpack it and run it EXACTLY on the desk top and their game was installed exactly at the default location. But if something isn't at the precise location I get a LITTLE confused about what to do.

I realize I'm on a short leash here so if we want to echo to the user exactly what is taking place I'm cool with that. If you guys were willing to help, you could hold onto the script and I would just provide an executable. That way the warnings to the users could not be removed.

Chad

It's possible to search the drive for servername.dat or perhaps query the registry for it's location.

When it's found - do you want the batch file to create a new servername.dat with the required contents? I'm assuming it is a text file with several lines inside so the batch file can create a new one rather than packaging another file.

So more details are needed - registry settings etc.Thanks everyone. I decided to abandon this approach. My Antivirus software lit up like a Christmas tree during a trial run. This would cause more problems than it solves if my players had to deal with that. What approach did you use that triggered your AV program? What tool were you using - because very few batch scripts will cause any issue with an AV program.Quote from: foxidrive on August 22, 2013, 01:42:16 AM
What approach did you use that triggered your AV program? What tool were you using - because very few batch scripts will cause any issue with an AV program.

I can't answer that without going into detail about it and the moderators don't want that posted here. The AV didnt REALLY become an issue until I COMPILED the script into an executable.


Discussion

No Comment Found