SlimShady Posted May 12, 2004 Share Posted May 12, 2004 (edited) Here's a run box replacement. If you run a command the box will stay be displayed. Until you press ESC or cancel.Changes:added support for resolution: 1024x768 (but I added static positions, easier)added Google searchTo open a website enter this (example)$i www.autoitscript.comSome other commands:windirsysdirprogdirdesktopmydocs$g keywords$b|file(s)First is the Windows directory.Second is the system directory.Third is the Program Files directory.Fourth is the desktop folderFifth is the "My Documents" folderSixth is search on Google for keywordsExample:$g James BondLast:You can create backups of file(s). The backup will be placed in your windows directory, in a folder backup. With the extension .backup.You can't backup files with no extension, but you can backup multiple files.See examples belowBackup examples:$b|desktop\important.doc $b|C:\scripts\test.au3 $b|sysdir\*.exe $b|progdir\AutoIt3\Examples\English\*.au3Any other command is the same as in the Windows run box.Like:notepad winword mspaint powerpnt excel write C:\ D:\ services.msc msconfigI figured something out . You can even use this (example):windir\CursorsAnd it works perfect!expandcollapse popup$g_szVersion = "Commandbox" If WinExists($g_szVersion) Then WinActivate("Commandbox") Exit EndIf AutoItWinSetTitle($g_szVersion) AutoItSetOption("RunErrorsFatal", 0) If @DesktopWidth = "1280" Then $pos = 810 Else $pos = 563 EndIf $Command = InputBox("Commandbox", " ", "", "", 250, 110, 0, $pos) If $Command <> "" Then While $Command <> "" Command($Command) $Command = InputBox("Commandbox", " ", "", "", 250, 110, 0, $pos) WEnd Exit Else Exit EndIf Func Command($Command) ;------------ Internet $Match = StringInStr($Command, "$i") If $Match > 0 Then $Command = StringReplace($Command, "$i", "iexplore") ;------------ Google $Match = StringInStr($Command, "$g") If $Match > 0 Then $Command = StringReplace($Command, "$g ", "iexplore www.google.com/search?q=") ;------------ System directories $Sysdir = StringInStr($Command, "sysdir") $Windir = StringInStr($Command, "windir") $Progdir = StringInStr($Command, "progdir") $Desktop = StringInStr($Command, "desktop") $MyDocs = StringInStr($Command, "mydocs") If $Windir > 0 Then $Command = StringReplace($Command, "windir", @WindowsDir) If $Sysdir > 0 Then $Command = StringReplace($Command, "sysdir", @SystemDir) If $Desktop > 0 Then $Command = StringReplace($Command, "desktop", FileGetShortName(@DesktopDir)) If $MyDocs > 0 Then $Command = StringReplace($Command, "mydocs", FileGetShortName(@MyDocumentsDir)) If $Progdir > 0 Then $Command = StringReplace($Command, "progdir", FileGetShortName(@ProgramFilesDir)) ;------------ Backup $Match = StringInStr($Command, "$b") If $Match > 0 Then Backup($Command) Return EndIf Run($Command) If @Error = 1 Then Run(@ComSpec & " /c Start " & $Command, "", @SW_HIDE) EndFunc;---Run command Func Backup($Command) $Command = StringSplit($Command, "|") $Backup = FileGetShortName($Command[2]) $Filename = StringSplit($Backup, "\") $Filename = $Filename[$Filename[0]] $Folder = @WindowsDir & "\backup" DirCreate($Folder) $Folder = $Folder & "\" FileCopy($Backup, $Folder & $Filename & ".backup") $Command = "" EndFunc Exit Edited May 13, 2004 by SlimShady Link to comment Share on other sites More sharing options...
brett Posted May 12, 2004 Share Posted May 12, 2004 (edited) i dont get what it does(*EDIT*): I'm and Advanced Member now Edited May 12, 2004 by brett -Brett Link to comment Share on other sites More sharing options...
SlimShady Posted May 13, 2004 Author Share Posted May 13, 2004 If you press Windows key+R you see the run box. It's the same but this commandbox can access folders faster. And you can backup files easily. See above for examples and commands. Link to comment Share on other sites More sharing options...
CyberSlug Posted May 13, 2004 Share Posted May 13, 2004 You might want to change the startup position of your InputBox.... I run at 1024x768 resolution, and it appears off screen Maybe try something such as: InputBox("Commandbox", " ", "", "", 250, 110, 10, @DesktopHeight-110-$taskbarHeight) You can get the position of the taskbar, on Windows XP at least, by using: WinGetPos("","Notification Area") ;returns array (x,y,width,height) for taskbar Thanks for sharing Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
SlimShady Posted May 13, 2004 Author Share Posted May 13, 2004 I forgot to adjust my script to that resolution. Thank you for the information. I will upload the new version soon. Link to comment Share on other sites More sharing options...
SlimShady Posted May 13, 2004 Author Share Posted May 13, 2004 Changes: - Added Google search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now