Changing Codepage by batch command in a file

Forum for DBF Commander discussing.

Changing Codepage by batch command in a file

Postby Maranwe » Sun Apr 23, 2017 12:06 pm

Hello I am new here and not yet that much experianced in batch and DBF etc.

My name is Stefan from Switzerland.
I found your software after looking for solutions to a problem I have.

The Problem is the following:

There is a LANGUAGE.dbf Database that contains diffrent languages for a software. In our case its mostly German.
Out of some unkown reason the codepage is being changed somehow and in the software or when printing out things letters like öäü are displayed with some other letters.
This is on codepage 850
When changing to codepage 1252 Windows Ansi they are displayed correctly and everything shows up right.

Now as the dbf file sometimes is corrupted that way I need a batch file that changes the codepage. I need to run the batch file with something like the software "Wait" on startup of windows to make sure that its done before the mainsoftware starts.


now I tried what I found here on the website:
***********
Set DBF file codepage

This command is similar to the Set codepage command. Syntax:

dbfcommander.exe -cp <file_name> <new_codepage>
<file_name> – the full name of the DBF file whose codepage flag you want to change.
<new_codepage> – the new codepage number (see the codepages list).
For example, the command

dbfcommander.exe -cp "D:\Data\products.dbf" 850

*********

so my command would be sth like that:

@echo off
cd "\Program Files (x86)\DBFCommander"
dbfcommander.exe -cp "C:\*****\Daten\language.dbf" 1252
exit


*********

This gives me errors like:

Canot open file "C:\Program Files (x86)\DBFCommander\ -cp " cant find the file


***********
the commander opens after the error but its emtpy.

if I remove some of the " " its the same

if I remove the -cp (whatever it is for) I get the same error and the commander opens with the loaded LANGUAGE.dbf but it doesn't change the codepage.
so i don't know why the error says it cant find the file!? Which file? Because it seems to open the commander and load the dbf... so I have no idea..

thanks for you help :)
Maranwe
 
Posts: 4
Joined: Sat Apr 22, 2017 5:24 pm

Re: Changing Codepage by batch command in a file

Postby Admin » Sun Apr 23, 2017 9:07 pm

Hello Stefan,
please try the following syntax:
Code: Select all
@echo off
"C:\Program Files (x86)\DBFCommander\dbfcommander.exe" -cp "C:\*****\Daten\language.dbf" 1252
exit
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 116
Joined: Wed Apr 21, 2010 7:27 pm

Re: Changing Codepage by batch command in a file

Postby Maranwe » Wed May 10, 2017 1:58 pm

Hello
Sorry for late reply
I tested it today and it shows this error:

atteched jpg!

Thanks for you help

the batch is in C: root
Attachments
error batch 001.jpg
error batch 001.jpg (41.91 KiB) Viewed 9290 times
Maranwe
 
Posts: 4
Joined: Sat Apr 22, 2017 5:24 pm

Re: Changing Codepage by batch command in a file

Postby Maranwe » Wed May 10, 2017 1:59 pm

oh it meand that the system can not find the file.
i don't know which one, as both are there, the commander.exe and the language.dbf
Maranwe
 
Posts: 4
Joined: Sat Apr 22, 2017 5:24 pm

Re: Changing Codepage by batch command in a file

Postby Admin » Wed May 10, 2017 4:34 pm

Stefan, please use DBF Commander Professional version instead of the Free one.
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 116
Joined: Wed Apr 21, 2010 7:27 pm


Return to DBF Commander Professional

Who is online

Users browsing this forum: No registered users and 1 guest

cron