Jump to content

Problem with Scheduled Tasks via Command Prompt


Recommended Posts

Posted

I have a quite bizarre problem to solve.

I've developed a Installer using Java to deploy my application easily and quickly.

One of the things the Installer does is use the command schtasks via Runtime to schedule PostgreSQL backup jobs. I can schedule jobs in any day of the week, except for saturday.

Why? Well, I'm from Brasil, and believe it or not, Microsoft have translated ALL parameters in all command line capacle apps.

In english based OS, the command

schtasks /create /ru SYSTEM /tn "Backup" /tr "c:\Backup\PGBackup.bat SatA" /sc WEEKLY /d SAT /st 13:00:00

works like a charm

In pt-br based OS, I have to use schtasks /create /ru SYSTEM /tn "Backup" /tr "c:\Backup\PGBackup.bat SatA" /sc SEMANALMENTE /d SÁB /st 13:00:00

If I type this command directly in the command prompt, it works, because it's possible to type Á, but if I use a .bat or .cmd file with all my schedule options or directly via Java Runtime, it doesn't work.

The Á comes out as a beta-like symbol. I've tried a lot of things, and none of them worked. Even using a schktasks.exe from an english based WinXP doens't work.

Does anyone have a clue what is needed and if it's possible to do this automatically?


Posted
Does anyone have a clue what is needed and if it's possible to do this automatically?

What are you using to actually write/edit the .bat/.cmd?

Maybe it's a problem with character sets. :unsure:

try doing the following:

ECHO SÁB>c:\test.txt

Open c:\test.txt with your ediitor.

Can you see the Á or has it become a Beta?

jaclaz

Posted (edited)

Thanks for the fast replies.

@iamthekey - Using charmap doens't work.

@jaclaz - the resulting txt contains this string: SµB

Now it returned a µ instead of a beta.

Oh, I forgot to answer the other question.

jaclaz, it really doens't matter if I use a Java IDE, notepad or edit to create a .bat/.cmd. It always comes out with this error.

OK, now it worked. I was trying to add SµB without " ".

Thanks a lot jaclaz.

Edited by FireBR

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...