ALT Strings
Moderators: Dorian (MJT support), JRL
ALT Strings
Hello All,
I have a script that I downloaded from the script page to do a defrag analysis on Windows 2000 professional. My scripts is as follows:
ExecuteFile>C:\WINNT\system32\dfrag.msc
WaitWindowOpen>Disk Defragmentor
Press Alt
Send Character/Text>A
Press Enter
Release Alt
WaitWindowOpen>Analysis Complete
Press Alt
Send Character/Text>d
The problem is that the Alt key never really gets sent. I have tested this with the notepad application and it works fine. Macro Scheduler flashes as if it is waiting for input. Any ideas?
Thanks
Charles
I have a script that I downloaded from the script page to do a defrag analysis on Windows 2000 professional. My scripts is as follows:
ExecuteFile>C:\WINNT\system32\dfrag.msc
WaitWindowOpen>Disk Defragmentor
Press Alt
Send Character/Text>A
Press Enter
Release Alt
WaitWindowOpen>Analysis Complete
Press Alt
Send Character/Text>d
The problem is that the Alt key never really gets sent. I have tested this with the notepad application and it works fine. Macro Scheduler flashes as if it is waiting for input. Any ideas?
Thanks
Charles
Does look as if Release ALT is missing. Any Press ALT must have a corresponding Release ALT.
MJT Net Support
[email protected]
[email protected]
ALT String
Thanks All, but it still does not work properly.
The following script still does nothing:
ExecuteFile>C:\WINNT\system32\dfrg.msc
WaitWindowOpen>Disk Degramentor
Press ALT
Send>A
Release ALT
Send>A
WaitWindowOpen>Analysis Complete
Press ALT
Send>d
Release ALT
It just does not work? Any additional ideas....
Thanks
The following script still does nothing:
ExecuteFile>C:\WINNT\system32\dfrg.msc
WaitWindowOpen>Disk Degramentor
Press ALT
Send>A
Release ALT
Send>A
WaitWindowOpen>Analysis Complete
Press ALT
Send>d
Release ALT
It just does not work? Any additional ideas....
Thanks
Hi,
Run the process manually. Notice the window names and keystrokes needed. Transform to a script. You have some help in the form of the script you have downloaded - even if it doesn't quite work - but you'll obviously have to do some of the work yourself.
Read the Scripting Windows for Beginner's guide in the documentation - it will help.
I would rewrite the script for you but I don't have access to Win2k at the moment and there may be something specific to your system to take into account.
Anyone with Windows 2000 able to verify this script and correct it?
Run the process manually. Notice the window names and keystrokes needed. Transform to a script. You have some help in the form of the script you have downloaded - even if it doesn't quite work - but you'll obviously have to do some of the work yourself.
Read the Scripting Windows for Beginner's guide in the documentation - it will help.
I would rewrite the script for you but I don't have access to Win2k at the moment and there may be something specific to your system to take into account.
Anyone with Windows 2000 able to verify this script and correct it?
MJT Net Support
[email protected]
[email protected]
Hi,
In Windows XP this works:
ExecuteFile>%SYS_DIR%\dfrg.msc
WaitWindowOpen>Disk Defragmentor
//send ALT-A-D (Action/Defragment)
Press ALT
Send>ad
Release ALT
That's all is needed. The script you have did analyze and then waited for another window to appear before proceeding to hit 'D' for defragment - but in my setup (XP) the window was named differently. The above script doesn't bother analyzing but goes straight in to the defrag.
In Windows XP this works:
ExecuteFile>%SYS_DIR%\dfrg.msc
WaitWindowOpen>Disk Defragmentor
//send ALT-A-D (Action/Defragment)
Press ALT
Send>ad
Release ALT
That's all is needed. The script you have did analyze and then waited for another window to appear before proceeding to hit 'D' for defragment - but in my setup (XP) the window was named differently. The above script doesn't bother analyzing but goes straight in to the defrag.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I may be able to access 2K system tonight, but I wonder if the spelling of the window is wrong?
WaitWindowOpen>Disk Defragmenter
If spelling is wrong, macro will wait forever for a non-existent window. Also, log the macro, what is log content showing?
WaitWindowOpen>Disk Defragmenter
If spelling is wrong, macro will wait forever for a non-existent window. Also, log the macro, what is log content showing?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Good spot. Yes, and I even copied it down in my post wrong. My little version of the script should be:
ExecuteFile>%SYS_DIR%\dfrg.msc
WaitWindowOpen>Disk Defragmenter
//send ALT-A-D (Action/Defragment)
Press ALT
Send>ad
Release ALT
ExecuteFile>%SYS_DIR%\dfrg.msc
WaitWindowOpen>Disk Defragmenter
//send ALT-A-D (Action/Defragment)
Press ALT
Send>ad
Release ALT
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: