Regarding SendKeys

Naidu.G
Member Posts: 31
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. ](*,)
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
-
Although not the most reliable (it can take a long time to recognize that it exists) you can use a record variable for the File table. Set your filters for the filename, path, and "is a file" fields and REPEAT UNTIL the file is found.0
-
Check the created files Size in the specific folder they are growing or not. For example after one minute...
Of course, if it is more than one file, the name is generated and find the last one.
:-k0 -
If you use the "Search the Forum" function, you will find this post.
http://www.mibuso.com/forum/viewtopic.php?t=21430
RegardsDo you make it right, it works too!0 -
hi garak,
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. ](*,)
Regards0 -
with the last {Enter} the systen accept the the ENTER command after the fbk is finished and used this ENTER for the message dlg.
Only problem: NAV must have the focus. Application must be active ....
So don't click when the backupprocess is running .......Do you make it right, it works too!0 -
Hi all,
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.
](*,)0 -
ähm, other question. do you use Native database or SQL database?Do you make it right, it works too!0
-
How can i find the backup is completed or not
Exists(FilePath)
???????? ..... :-kSandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
Hi,
i am using Navtive database
Thanks & Regards0 -
the navbackup lite, in the download section, works great for me0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions