JoGeek
asked on
Errorhandling by using the shell-function!!!
Hello,
i have to make a backup-/restoreroutine for firebird/interbase-dbs!
In vb I use the shell-function to call the programm gbak (programm for backup/restore firebird-dbs)
but i have to know, if the routine has occure an error in some way!! (you don't get the errormessages, you get in the cmd).
the vb-programm easily goes to the next command and doesn't matter what's happened in the cmd-routine!!
Is there any way to know, if the shell-function has occured an error???????
Thanx in advance
JoGeek
i have to make a backup-/restoreroutine for firebird/interbase-dbs!
In vb I use the shell-function to call the programm gbak (programm for backup/restore firebird-dbs)
but i have to know, if the routine has occure an error in some way!! (you don't get the errormessages, you get in the cmd).
the vb-programm easily goes to the next command and doesn't matter what's happened in the cmd-routine!!
Is there any way to know, if the shell-function has occured an error???????
Thanx in advance
JoGeek
there is some errorlevel handling that you can use but it would be very rudimentary
source : http://www.rootshell.be/~jouell/nt/shell.html
you could also try to use a vbs script instead of a shell script if your situation allows for that
source : http://www.computerperformance.co.uk/ezine/ezine15.htm
source : http://www.rootshell.be/~jouell/nt/shell.html
you could also try to use a vbs script instead of a shell script if your situation allows for that
source : http://www.computerperformance.co.uk/ezine/ezine15.htm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This function is really great, thank you!
But my command returns an error despite the fact that directly on the cmd it works:-\
Well, here's the command:
C:\Programme\Firebird\Fire bird_1_5\b in\gbak -V -T -user "SYSDBA" -password "masterkey" localhost:"C:\test.fdb" "C:\test.fdb.fbk"
The errormesage is:
gbak: ERROR: Unable to complete network request to host "localhost".
gbak: ERROR: Failed to locate host machine.
gbak: ERROR: The specified name was not found in the hosts file or Domain Name Services.
gbak: Exiting before completion due to errors
Strange is, that, if i leave out the "localhost": , it works fine!!!
What could be the problem??
with kind regards,
JoGeek
But my command returns an error despite the fact that directly on the cmd it works:-\
Well, here's the command:
C:\Programme\Firebird\Fire
The errormesage is:
gbak: ERROR: Unable to complete network request to host "localhost".
gbak: ERROR: Failed to locate host machine.
gbak: ERROR: The specified name was not found in the hosts file or Domain Name Services.
gbak: Exiting before completion due to errors
Strange is, that, if i leave out the "localhost": , it works fine!!!
What could be the problem??
with kind regards,
JoGeek
ASKER
Okok, it was a fault of gbak:\
Does somebody knows, how gbak can work with mapped devices?????
Thanx,
JoGeek
Does somebody knows, how gbak can work with mapped devices?????
Thanx,
JoGeek
https://www.experts-exchange.com/questions/20899876/Shell-command.html
https://www.experts-exchange.com/questions/20252939/LPR-command-in-VB-Capturing-error-messages-codes.html
Leon