Jump to content

CyberSlug

MVPs
  • Posts

    3,444
  • Joined

  • Last visited

  • Days Won

    1

CyberSlug last won the day on November 25 2019

CyberSlug had the most liked content!

1 Follower

About CyberSlug

Profile Information

  • Member Title
    Overwhelmed with work....
  • Location
    Kentucky, USA
  • WWW
    http://people.eku.edu/gumpp/AutoIt/

Recent Profile Visitors

784 profile views

CyberSlug's Achievements

Universalist

Universalist (7/7)

6

Reputation

  1. I have some compiled AutoIt scripts that run from a network drive. The scripts worked fine on XP. With Vista, the scripts would only work if run locally. (UAC is disabled; I think the issue was with some nested RunAs magic and how Vista handles credentials.) Anyway, the following fixed all my scripts that broke with Vista: If FileGetLongName(@TempDir) <> FileGetLongName(@ScriptDir) Then FileCopy(@ScriptName, @TempDir & "\" & @ScriptName) Run(@TempDir & "\" & @ScriptName) Exit EndIf ;This script is running locally now. MsgBox(0x1000, "Test", "Running locally now" & @LF & @ScriptDir) ; Optionally use the _SelfDelete() UDF to clean up after self... P.S. It's been too long since I've been on the forums!
  2. I know this is an old thread, but I'm posting the following for reference purposes: ;Seems to work... $computerName = @ComputerName ;Change as needed $strNewParentDN = "LDAP://OU=Accounting,OU=Administrative,DC=example,DC=com" $strObjectDN = "LDAP://CN=" & $computerName & ",OU=machines,DC=example,DC=com" $strObjectRDN = "CN=" & $computerName $objCont = ObjGet($strNewParentDN) $objCont.MoveHere($strObjectDN, $strObjectRDN)
  3. Look at the Chr and Asc functions. Also look at all the examples in docs for Random $letter = Chr(Random(Asc('a'), Asc('z'), 1))
  4. This example warns you if you try to put one of the "forbidden" \ / : * ? " < > | characters in the box I use message-loop mode, but you could easily adapt for onevent mode. #include <GUIConstants.au3> $GUI = GUICreate("Enter a name for a new folder....", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES $file = GUICtrlCreateInput ( "", 10, 20, 300, 20) $btn = GUICtrlCreateButton ("Ok", 40, 95, 60, 20) GuiSetState(@SW_SHOW) Dim $previousText While 1 $msg = GUIGetMsg() If $msg = $btn Or $msg = $GUI_EVENT_CLOSE Then Exit $text = GuiCtrlRead($file) If $previousText <> $text Then ToolTip("") If StringRegExp($text, '\\|/|:|\*|\?|\"|\<|\>|\|') Then GuiCtrlSetData($file, StringRegExpReplace($text, '\\|/|:|\*|\?|\"|\<|\>|\|', "")) DllCall ("user32.dll", "int", "MessageBeep", "int", 0xFFFFFFFF) ;Beep Local $tooltipPos = WinGetPos($GUI) ToolTip("A file name cannot contain any of the following characters:" & @LF & _ ' \ / : * ? " < > |', $tooltipPos [0]+160, $tooltipPos [1]+60, Default, Default, 3) $previousText = GuiCtrlRead($file) Endif Wend
  5. Wow, I haven't posted in a LONG time. The info at http://community.bartdesmet.net/blogs/bart...09/23/3554.aspx was helpful in creating the following function (which I've only tested under XP Pro, by the way): ;The following function adds a network place to "My Network Places" ; $networkResource is of the form \\server\share OR http://webserver/share OR ftp://ftp.example.com/ ; $name can be any valid file name, i.e., it Cannot contain the characters \ / : * ? " < > | ; Func _FileCreateNetworkPlace($networkResource, $name) Local $NHItem = @UserProfileDir & "\NetHood\" & $name DirCreate($NHItem) FileSetAttrib($NHItem, "+S") FileCreateShortcut($networkResource, $NHItem&'\target.lnk', "", "", $networkResource) IniWriteSection($NHItem&'\desktop.ini', ".ShellClassInfo", "CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}" & @LF & "Flags=2") Local $success = FileSetAttrib($NHItem&'\desktop.ini', "+SH") ;;ShellExecute(@UserProfileDir & "\NetHood\" & $name) ;Open Network Place when Finished... Return $success EndFunc;Example usage _FileCreateNetworkPlace("\\Laptop\Share", "Stuff")
  6. Open up regedit and look under the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ Create a new key with the name you want to run, and set its default value to the full path to the program. Another way is to create shortcuts that exist in PATH. For example, LNK files in the @SystemDir and @UserProfileDir folders can be run the same way.
  7. Usually your CD burning software lets you choose the title, volume name, whatever of the disc you create.
  8. ; Might help? Opt("WinSearchChildren", 1) Opt("WinDetectHiddenText", 1) #cs WinDetectHiddenText Specifies if hidden window text can be "seen" by the window matching functions. 0 = Do not detect hidden text (default) 1 = Detect hidden text WinSearchChildren Allows the window search routines to search child windows as well as top-level windows. 0 = Only search top-level windows (default) 1 = Search top-level and child windows #ce
  9. Check the Daemon Tools help file for command line options.... For example, I have the following script (compiled to an EXE) associated with ISO files. It allows me to double click an ISO, mount it as G:, and show the contents in Explorer: ; MountHelper.au3 Assumes that G: is the Daemon Tools Virtual drive... #noTrayIcon If $CmdLine[0] = 0 Then Exit FilechangeDir(@ScriptDir) RunWait('"daemon.exe" -unmount 0') RunWait('"daemon.exe" -mount 0, ' & """" & $CmdLine[1] & """") While DriveStatus("G:") = "NOTREADY" sleep(100) WEnd Run("explorer G:")
  10. Why don't you just use AutoIt's built-in RegWrite and RegDelete commands?? If you have a bunch of keys to manipulate, take a look at http://www.autoitscript.com/forum/index.php?showtopic=7771 to automatically convert the REG file to an AutoIt script
  11. Boot up with your XP CD to the Recovery Console, and run the FIXBOOT command. http://support.microsoft.com/kb/314058 Easier to read: http://www.planetamd64.com/index.php?s=&am...st&p=234019
  12. Also check out http://www.911cd.net/forums/ For listing USB devices, I perfer http://www.jsifaq.com/SF/Tips/Tip.aspx?id=8496 DiskPart http://support.microsoft.com/kb/300415 I can tell you right now that scripting DiskPart is annoying... http://www.autoitscript.com/forum/index.ph...amp;hl=diskpart However, once you get a drive letter, it should work. (Well, I use BartPE with a plugin that enables the diskmgmt.msc GUI and the drive works after the letter is assigned.)
  13. Yes, and No. The operating system can report whatever MAC address you want it to.... In fact, many manufactures have nic drivers that allow you specify a MAC address, as shown in screenshot below. (If you don't override it, the default value hard-coded in the NIC is used as the MAC address.) Interesting read: http://www.klcconsulting.net/Change_MAC_w2k.htm
  14. Microsoft offers a program for XP: http://www.softpedia.com/get/Security/Lock...te-Folder.shtml
  15. http://www.appdeploy.com/packages/detail.asp?id=495 http://www.appdeploy.com/messageboards/tm.asp?m=20674 There are posts that tell how to resume script after reboot of computer. (It could be as simple as adding the installer to the RunOnce registry key....)
×
×
  • Create New...