Hi Experts,
I created a form in that i wrote code in ontimer trigger
for taking the database backup .Once if it completes to take the backup i recieve one message that backup is successfully completed. But my problem is how to find when the backup is completed, in that time i want to automatically press enter. But i wrote the code using the sendkeys function it is not working.
Ex:-
wscript.sendkeys(%tb);
wscript.sendkeys(descriptin);
wscript.sendkeys({tab});
wscript.sendkeys(filename);
wscript.sendkeys({tab});
wscript.sendkeys({enter});
like that i wrote the code, but my probleam is when the backup is completed and how to automatically press enter.
After the above code i wrote the code
if i = 1050 then
wscript.sendkeys({enter});
i+=1;
but this code is execute after 3 minits but the database is large means how the backup is completed the 3 minits itself so, how to find the backup completion. ](*,)
0
Comments
My Blog - nav.education
Of course, if it is more than one file, the name is generated and find the last one.
:-k
http://www.mibuso.com/forum/viewtopic.php?t=21430
Regards
i download the automatic backup form in mibuso downloads but in that also after taking the database backup we have to manually press enter. but my probleam is after taking the backup automatically press the enter and i should know when the backup is completed. ](*,)
Regards
Only problem: NAV must have the focus. Application must be active ....
So don't click when the backupprocess is running .......
i wrote the code in ontimer trigger as follows.
FilePath := FORMAT(DATE2DMY(TODAY,1));
FilePath += FORMAT(DATE2DMY(TODAY,2));
FilePath += FORMAT(DATE2DMY(TODAY,3));
FilePath += DELSTR(FORMAT(TIME),3,9);
IF State = 0 THEN
FilePath += 'Hours';
FilePath1:='NavBackup' + FilePath+'.fbk';
FilePath:='D:\NavBackup'+FilePath+'.fbk';
IF State = 0 THEN BEGIN
wscript.SendKeys('%tb');
DT := CREATEDATETIME(TODAY,T);
END;
IF State = 2 THEN
wscript.SendKeys('Nav Backup');
IF State = 3 THEN
wscript.SendKeys('{tab}');
IF State = 4 THEN
wscript.SendKeys(FilePath);
IF State = 5 THEN
wscript.SendKeys('{tab}');
IF State = 6 THEN
wscript.SendKeys('{ENTER}');
If State = 15 then
wscript.SendKeys('{ENTER}');
IF State = 16 THEN
SHELL('c:\windows\system32\cmd.exe');
IF State = 20 THEN
wscript.SendKeys('cd\');
IF State = 23 THEN
wscript.SendKeys('{enter}');
IF State = 25 THEN
wscript.SendKeys('d:' );
IF State = 27 THEN
wscript.SendKeys('{enter}' );
IF State = 28 THEN
wscript.SendKeys('if exist ' );
IF State = 29 THEN
wscript.SendKeys(FilePath1);
IF State = 30 THEN
wscript.SendKeys(' rar a ');
IF State = 32 THEN
wscript.SendKeys('d:\nav1.rar ');
IF State = 35 THEN
wscript.SendKeys(FilePath);
IF State = 38 THEN
wscript.SendKeys('{enter}');
IF State = 45 THEN
wscript.SendKeys('exit');
IF State = 48 THEN
wscript.SendKeys('{enter}');
IF State = 88 THEN
BEGIN
wscript.SendKeys('%{tab}');
wscript.SendKeys('esc');
END;
State+=1;
But my problem is after taking the backup it shows the message like backup is successfully completed, after that i worte the automatic zip also
but that code is not working because of the message box (Backup is successfully completed) when ever we press enter key manually after that the remaining code will be executed.
How can i find the backup is completed or not
Thanks & Regards,
Naidu.
](*,)
Technical Consultant, MS Dynamics NAV
i am using Navtive database
Thanks & Regards
http://www.BiloBeauty.com
http://www.autismspeaks.org