Jump to content

sb1920alk

Active Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by sb1920alk

  1. Sorry, I'm having the same issue with that change.
  2. I'm trying to make a hotkey (Ctrl-Shift-v) to type the contents of the clipboard for use in situations where a traditional "paste" doesn't work for whatever reason. The problem I'm having is that the script seems to break my regular shift and ctrl keys, as if they're stuck down. I have to exit the script and press and release the "stuck" keys to fix it. Any ideas? Here is the script: ;Set Hotkey of Ctrl-Shift-V to type clipboard text. ;Useful for situations that don't permit traditional pasting #include <Clipboard.au3> HotKeySet("+^v", "TypeClipText") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func TypeClipText() $Text = ClipGet ( ) Send($Text,1) EndFunc Func Terminate() Exit 0 EndFunc ;==>Terminate
  3. I'm trying to see if someone has already written a script like this. I would like to manually arrange my open program windows, then have the script take a snapshot of the size and position of all of the windows. After time passes and I've moved things around I would like to be able to run a script to restore my windows to the position and size previously saved. Taking it further, I would like it to start applications that aren't started if they're part of the collection of windows (for example if Outlook is one of the windows and I closed it while working, then the restore script would restart Outlook when necessary), and save and restore between multiple snapshots. These different snapshots could be for different types of tasks (development, emailing, browsing, or whatever). Thanks,
  4. I would like to know if it's possible to watch for a button, and if it's clicked, trigger some code. Specifically: I have a legacy application that to print, takes a screen shot of the application window, opens a print dialogue box, then sends the screen shot to the chosen printer. On Windows XP, that was fine. On Windows 7, it's actually including the print dialogue box in the printout. ...already contacted the vendor and it's unlikely they're going to do anything about it. So, if I could monitor the "Print" button on the print dialogue box, when the user clicks "Print" I could trigger a function to move the box or make it hidden or something, then click the "Print" button. I'm comfortable with everything in the script except the "Monitor_a_control_and_do_something_before_it_does_what_it_was_originally_intended_to_do" feature. FYI, I've already tried remapping the printscreen key to dump a screen shot to a file, then print it. That sort-of works, but the legacy app isn't using a pure screenshot. Instead, it's doing some things with the layout that the users are used to and I haven't been able to reproduce all of those settings.
  5. ...just to make sure you know it's an option. defrag c: -a -v
  6. If "unfragmented" and "fragmented" only appear once in the log, you can real the whole file to a variable, split it by lines, then loop through the array of lines. In the loop, if the line contains "unfragmented", use text manipulation to pull out the bytes and set a variable equal to it. Use a different variable for "fragmented". Look at fileread, stringsplit, for...in...next, stringinstr
  7. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop\TaskbarWinXP, I think is what you're looking for, but it's ugly. I'm pretty sure changes you set artificially will be lost when the user logs off. You can set it in a startup script that loops through each user's hive and imports a template from a reg file you make from a reference machine...I guess. Also consider editing your Default User settings to include this.
  8. Well, you can customize it so it doesn't show all of the information. If you do plan to deploy it, I would probably put it and the configuration file in netlogon, and call it from the logon script. ...so, the end users will be clicking on the toolbar to open the folder, or launch a script or exe? I'm not sure what you mean here.
  9. ...just being thorough. http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx
  10. If your goal is to have users quickly identify their computer name, you could set HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\LocalizedString to %computername%. Then instead of "My Computer", My Computer will be their computer name. It's not a toolbar, but...
  11. mciSendStringW failed with first call Error code number = 306 ...click OK... mciSendStringW failed with second call Error code number = 306 ...click OK... mciSendStringW failed with third call Error code number = 263
  12. I have not worked with DllCalls much before.
  13. That worked. Very nice...thank you. I much prefer code I can see rather than a black box like the exe above I found. I still wonder why CDTray didn't work.
  14. I have a solution now, so it's not a big deal. I tried adding the scripting package and running this vbscript: Const CDROM = 4 For Each d in CreateObject("Scripting.FileSystemObject").Drives If d.DriveType = CDROM Then Eject d.DriveLetter & ":\" End If Next Sub Eject(CDROM) Dim ssfDrives ssfDrives = 17 CreateObject("Shell.Application")_ .Namespace(ssfDrives).ParseName(CDROM).InvokeVerb("E&ject") End Sub ...but it did nothing. Since I already added the scripting package, I tried this: Set oWMP = CreateObject("WMPlayer.OCX.7" ) Set colCDROMs = oWMP.cdromCollection For i = 0 to colCDROMs.Count - 1 colCDROMs.Item(i).Eject Next ...but it errored (no WMP in WinPE). Running the original au3 as adminitrator didn't help. I stumbled across this link: http://memberwebs.com/stef/software/eject/eject.exe, and it worked fine. Obviously, I would prefer not to have to rely on a helper file, but it's good enough for now. If anyone can get the tray to open in WinPE 3.0 with pure AutoIT code, or vbscript, please let me know. Thanks,
  15. No error. Running your code did nothing visible. I tried msgbox too, but still no. Then I ran the code below to make sure it was doing something. I get a message box with d: in it. So...it can list the drives, but the CDTray function isn't doing anything. Also, if I open Notepad, File->Open, right-click on the cd drive, and select "Eject", it really does eject, so WinPE has the ability to open the tray. I added @error to my message box and it's returning 0, so CDTray thinks it's locked or it's not a CD drive or something, even though DriveGetDrive says it is a CD drive. I'm not sure. $var = DriveGetDrive( "CDROM" ) If NOT @error Then For $i = 1 to $var[0] CDTray($var[$i],"open") MsgBox(0,"",$var[$i] & @CRLF & @error) Next Else MsgBox(0,"",@error) ConsoleWrite(@error & @CRLF) EndIf
  16. I'm using WinPE 3.0. This script opens the CD tray fine in XP, but not in WinPE. Any ideas or can someone confirm that it is not possible? Thanks $var = DriveGetDrive( "CDROM" ) If NOT @error Then For $i = 1 to $var[0] CDTray($var[$i],"open") Next EndIf
  17. Thanks for the reply. I'll try it.
  18. I'm looking for a band-aid. I have a user logged in to a terminal server. After x amount of idle time the session disconnects, and after y more idle time the session logs off. In this particular situation, I can't change the user account properties, the terminal server configuration, or group policy, so I'm looking for a script the the user can run when they think they'll be idle for a while that will trick the terminal server into thinking they're not idle. I've tried the obvious mouse moves and keystrokes, but they aren't working. ...and if it could keep the session alive after the user disconnects, that would be really great.
  19. I'm trying to set the default keyboard language in a logon script for users in other countries who use the same Default User template as everyone else. I put together the script below from bits and pieces I found in other threads. I call it with a parameter like 00000409 or 00000809. It works fine for all of the windows that are open, but if I open a new window, it uses the original input layout. What I need is to reproduce the effect of setting it in Control Panel\Regional and Language Options\Languages\Details...\Default input language., but even that doesn't seem to do the change right away. Typing in the Run line gives me the old language and in a new notepad window gives me the new language. Setting HKEY_CURRENT_USER\Keyboard Layout\Preload is great, but it doesn't take effect until the next logon. If $CmdLine[0] <> 1 Then Exit(1) $KeyBoardLayoutCode = $CmdLine[1] $allwindows = WinList() For $i = 1 to $allwindows[0][0] If IsVisible($allwindows[$i][1]) Then _SetKeyboardLayout($KeyBoardLayoutCode, $allwindows[$i][1]) EndIf Next Func _SetKeyboardLayout($sLayoutID, $hWnd) Local $WM_INPUTLANGCHANGEREQUEST = 0x50 Local $ret = DllCall("user32.dll", "long", "LoadKeyboardLayout", "str", $sLayoutID, "int", 0) DllCall("user32.dll", "ptr", "SendMessage", "hwnd", $hWnd, "int", $WM_INPUTLANGCHANGEREQUEST, "int", 1, "int", $ret[0]) EndFunc Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc I tried it for all windows instead of just the visible ones, but it didn't make any difference. How can I change the keyboard language for all programs, and new windows without logging off and logging back on? Thanks. [Edit: Spelling]
  20. That was fast! Thanks to both of you.
  21. How can I get the handle of the active window? I won't know ahead of time the title or text. I don't want to cycle through a WinList array, because I may have several windows with the same title. Thanks.
  22. Ok. Thanks anyways. It won't hurt too much to have the "Block Input" script continue running after it's been unlocked with Ctrl-Alt-Del. Any other ideas for protecting an unattended WinPE console?
  23. I want to use it while some .bats run in Windows PE. I'd prefer to lock the console, but I don't know of a way to do that in PE and this is the next best thing, but I don't want it to continue running after it's been unlocked. I suppose if there's no way to do it, I can call the .bat from the AutoIT script, but I prefer not since the others that need to use it all speak bat and not AutoIT.
  24. I'd like to block input and detect when it has been unblocked by someone pressing Ctrl-Alt-Del, then continue with code and so the script won't be stuck in an infinite loop (not so I can block it again). Something like this: ...do some stuff BlockInput(1) While InputIsBlocked sleep(50) WEnd ...do more stuff. Any ideas? Thanks,
  25. Thanks for the quick response. For various reasons, I am trying to match the exact look of vbscript's input box.
×
×
  • Create New...