Jump to content

perwhis

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by perwhis

  1. The task is to automatically change the target of hundreds of shortcuts, due to changes of server names. I am pretty sure I have seen someone solve this already, but I cannot find the solution any longer, so I gave it a try myself. Unfortunately I am not an experienced AutoIt scripter, so there are some things I still need to sort out. This is what my (messy) script looks like this far: $old_path = "dokument-2" $new_path_NT = "pp.tr\dok" $new_path_9x = "dokument-4" ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile("*.lnk") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) ; Read in the path of a shortcut $details = FileGetShortcut($file) MsgBox(0, "Path:", $details[0] & @CR & $details[1] & @CR & $details[2] & @CR & _ $details[3] & @CR & $details[4] & @CR & $details[5] & @CR & $details[6]) ; Check if shortcut contains old path and replace with new If StringInStr($details[0], $old_path) And @OSTYPE = "WIN32_NT" Then StringReplace($details[0], $old_path, $new_path_NT) If StringInStr($details[1], $old_path) And @OSTYPE = "WIN32_NT" Then StringReplace($details[1], $old_path, $new_path_NT) EndIf ; Send current shortcut to recycle bin if contains path to change MsgBox(0, "Delete", $file) ; FileRecycle($file) ; Create new shortcut with new path ; FileCreateShortcut($details[0], $file, $details[1])") EndIf WEnd ; Close the search handle FileClose($search) 1. At the moment the script only looks for shortcuts in the current folder. How do I make it search all shortcuts in a harddisk or in a server? 2. I'm insecure about how FileCreateShortcut works. Can I somehow give the full $details-array to preserve all contents? If so, what should it look like? 3. I need to give different paths depending on OS-type, and I feel I do it in a very clumsy way. Any suggestions on better ways to do it? (I've only put NT in code yet, but will repeat it with a different if-statement.) Cheers!
  2. I follow this thread from time to time, and I find this solution for serial communication extremely interesting. I am very impressed by the work this far, and I keep my fingers crossed that this udf will be further developed. Many thanks for the work done already!
  3. 1) Excuse my ignorance, but is there a way to disable ctrl-alt-del? I'm a newbe and don't know how to make dll-calls, but on this site http://www.andreavb.com/tip020011.html I found the following text... which I think may work also with AutoIt? -------- :: How to Disable the Ctrl-Alt-Del keys combination... Author Andrea Tincani Language VB5, VB6 Operating Systems Windows 95 and 98 API Declarations Private Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long Module Sub DisableCtrlAltDelete(bDisabled As Boolean) Dim x As Long x = SystemParametersInfo(97, bDisabled, CStr(1), 0) End Sub --------- 2) Is it possible use this great script so that I need to push many buttons to unlock the PC? It would e.g. be nice if all five buttons esc, f1, f2, f3, f4 had to be pushed at the same time. 3) Since this is my first post I also take the chance to ask if there is any way to send a ctrl-alt-del while the computer is locked? I know that it is often done by remote control software, like e.g. VNC, so I suppose it should be possible to do even if it is not not very simple.
×
×
  • Create New...