Talentless Hack

  • All
  • Read
  • Write
  • Hack Contact
  • Friday Apr 25 2008 (11:14 am)

    Perpetually prompting

    Usually Prompted Macros in ZENworks application objects only prompt for values on their first runs. To create one that will prompt for a macro value every time, add the following to a Run after termination script (or append it to the end of your script if you already have one):

    RD C:\NALCache\ETREE\.Application-Name.OU.OU.O /S /Q

    REG.EXE DELETE HKCU\Software\NetWare\NAL\1.0\Distribute\TREE_NAME\XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /f

    REG.EXE DELETE HKLM\SOFTWARE\NetWare\NAL\2.X\Macros\TREE_NAME\XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /f

    Script Engine: %*WINSYSDIR%\cmd.exe /c
    Script Extension: .bat

    Replace .Application-Name.OU.OU.O with the DN of your application object.
    Replace TREE_NAME with the name of your eDirectory tree.
    Replace XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX with the GUID of the application object.

    Friday Apr 11 2008 (4:49 pm)

    Finding Firefox

    I was trying to write an AutoIT script to manipulate the Firefox user.js preferences files, which are stored in the users’ Firefox profile folders. Unfortunately with Firefox, the initial user profile is created in a “salted” directory under %appdata%\Mozilla\Firefox\Profiles. The folder name uses a randomly generated 8-character string followed by a dot and the word default, like this: df3etnz3.default. This can make scripting modifications of the user preferences a real pain in the ass, as you can’t be sure what the name of the user profile folder is.

    Fortunately, there’s a file named profiles.ini in %appdata%\Mozilla\Firefox that lists the folder name, so we can pull the information from there. The initial profile will be listed on line 7 of the profiles.ini so:

    ; Find the Firefox user profile
     $file = FileOpen(@AppDataDir & "\Mozilla\Firefox\profiles.ini", 0)
    ; Extract the raw profile path
     $rawpath = FileReadLine($file, 7)
     FileClose($file)
    ; Extract the actual Firefox profile directory
     $mozfolder = StringRight($rawpath, 16)
    ; Create Profile Path variable
     $mozpath = @AppDataDir & "\Mozilla\Firefox\Profiles\" & $mozfolder

    Now you can just reference the profile path using $mozpath.

    Wednesday Apr 09 2008 (6:52 am)

    I have a scheme (naming that is)

    Because I work for a large advertising conglomerate -

    BrainStorm, ThinkTank, BrightIdea, WowFactor, BreakThrough, TechSavvy, PopCulture, MediaBlitz, StarPower, FastTrack, ComfortZone, GamePlan, TouchBase, HotConcept, MindSet, NextLevel, DayDream, KnowledgeBase, CriticalMass, RazorsEdge, OldSchool, TeamPlayer, WinWin, TaskForce, MileStone, CoreValue, MasterPlan

    Of course, I’ll never get to use these…we’ll wind up giving them some ridiculous set of numbers and letters that no one can remember like NYNWPRPZPSN0104 or something equally inscrutable.

    Tuesday Apr 08 2008 (8:32 pm)

    Run away from home

    In most situations, when I need to run an installation using Local Administrator rights on a locked down workstation, using ZENworks I can just set the Application Object to Run as unsecure system user and be done with it. This allows the installer to interact with the desktop so I can still give the users progress bars and dialog boxes, but the install runs with administrative rights.

    Unfortunately Run as unsecure system user requires an imported workstation object, and while the workstation import service is working flawlessly at many of our sites, it’s not hitting every computer in others and broken in some (thanks in large part to servers being moved around in the tree as part of an ongoing re-engineering project). »

    Tuesday Apr 01 2008 (11:04 pm)

    Why is it backwards?

    שֵׁת ירד