Jump to content

Is it possible to create script in silent mode and how to create


Recommended Posts

In first of all - i am from Latvia, so please be patient and i am sorry of my bad English.

I am new in autoit script writing, so i have to questions about it...

1. How to create script in silent mode, so the windows that autoit is opening is invisible?

For example

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "Do you want to save")
Send("!n")

Is it possible to make all these actions invisible?

2. is it possible to write script, that cant be disturbed?

For example - when i make a mouse click, while script is running - script pauses...

how to write script that wouldn't pause on mouse click?

Please give me some examples!

Link to comment
Share on other sites

Hi,

Is it possible to make all these actions invisible?

They already invisible, if you need to run some program as hidden, then do like this:

Run("notepad.exe", "", @SW_HIDE)

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

But what i hawe to do to hide all the windows that script is opening?

And i wasn't talking about the tray icon only.

when i do a mouse click on the desktop, or anywhere else, script pauses! I want to do other actions while script is running (like open my computer for example) and script doesn't pause...

Edited by monochrome90
Link to comment
Share on other sites

Good time to post your code because a script should not interfere with normal operation. That would indicate there is something in the script causing the problem.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

This is my code! <_<

RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Registration\{91120000-002F-0000-0000-0000000FF1CE}")
ShellExecute ("nonemt.reg")
WinWaitActive ("Registry Editor", "Are you sure you want to add the information")
Send ("!y")
WinWaitActive ("Registry Editor", "Information in")
Send ("{ENTER}")
Run ("Proof.exe")
Edited by monochrome90
Link to comment
Share on other sites

This is my code! <_<

RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Registration\{91120000-002F-0000-0000-0000000FF1CE}")
ShellExecute ("nonemt.reg")
WinWaitActive ("Registry Editor", "Are you sure you want to add the information")
Send ("!y")
WinWaitActive ("Registry Editor", "Information in")
Send ("{ENTER}")
Run ("Proof.exe")
Right off the top, what you are trying to do could be better accomplished just by using the Registry functions instead of the Send()s.

Second

Do a Google search for RegEdit+"Command Line" to get a list of switches that could be used with RegEdit and then include what you want in a RunWait().

As in

RunWait("RegEdit /s nonemt.reg")

See RegEdit at

Command Line Switches.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Moderators

Funny, I like how that is set up.

1. Don't read the original value of that registry entry.

2. Delete the registry entry entirely.

3. Then ask "Are you sure you want to add the info."!!!

<_< A bit late and a redundant question at that point isn't it?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Funny, I like how that is set up.

1. Don't read the original value of that registry entry.

2. Delete the registry entry entirely.

3. Then ask "Are you sure you want to add the info."!!!

<_< A bit late and a redundant question at that point isn't it?

Once the key is deleted then you might consider the question a bit redundant, yes.

That's one reason why just using registry functions (in the proper order) might be a better solution. Of course a "Are you sure you want to screwup the users registry" msg box with Yes/No would be a good addition right up at the top of the script.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Right off the top, what you are trying to do could be better accomplished just by using the Registry functions instead of the Send()s.

Second

Do a Google search for RegEdit+"Command Line" to get a list of switches that could be used with RegEdit and then include what you want in a RunWait().

As in

RunWait("RegEdit /s nonemt.reg")

See RegEdit at

Command Line Switches.

thanks!

Link to comment
Share on other sites

Funny, I like how that is set up.

1. Don't read the original value of that registry entry.

2. Delete the registry entry entirely.

3. Then ask "Are you sure you want to add the info."!!!

<_< A bit late and a redundant question at that point isn't it?

i already said than i am a new in script writing, so please be patient!

RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Registration\{91120000-002F-0000-0000-0000000FF1CE}")oÝ÷ Ú)í+%w¢ç¶âض«z+-Ââë"Øb²· ËkÊ­'íêÞȧyçm¡×¥z×­éºØ¢{g£hÂÚ¢ØZ¶'âÂ)evajؽéð¢é]m綬)Þjëh×6RunWait("RegEdit /s nonemt.reg")

with first line i delete all path instead of two files from that path. wih second line i create that path without those files...

Edited by monochrome90
Link to comment
Share on other sites

i already said than i am a new in script writing, so please be patient!

RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Registration\{91120000-002F-0000-0000-0000000FF1CE}")

in this line i need to find if there is two files in this registry path, if there is i need to delete them, but i dont now how to do that...

Links:

RegRead()

RegEnumKey()

RegEnumVal()

EDIT: What 2 files are you looking for? There may be other places to look.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Moderators

RegEnumKey()

_OfficeDeleteRegistration()

Func _OfficeDeleteRegistration($nVersion = "12.0")
    Local $strEnumKey, $nEnum
    Local $strKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\" & $nVersion & "\Registration\"
    While 1
        $nEnum += 1
        $strEnumKey = RegEnumKey($strKey, $nEnum)
        If @error <> 0 Then ExitLoop
        RegDelete($strKey & $strEnumKey)
    WEnd
    Return
EndFunc

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

EDIT: What 2 files are you looking for? There may be other places to look.

DigitalProductID (REG_BINARY)

ProductID (REG_SZ)

there cant be other place to look! this is the registry path that's created afte M$ Office instalation!

Whoa tiger, he was trying to be helpful... don't bite the hand that feeds ya.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

i am sorry if i was rude... <_< i didnt want to, i just wanted to point that there cant be other path...

i am sorry if i was rude, i realy didnt want to, and i still need help... :)

You need help? I gave you not only how to find them but how to delete them too...

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

EDIT: What 2 files are you looking for? There may be other places to look.

DigitalProductID (REG_BINARY)

ProductID (REG_SZ)

there cant be other place to look! this is the registry path that's created afte M$ Office instalation!

To quote you

there is two files in this registry path

If you had said 2 entries I wouldn't have made the suggestion.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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