Monday, May 25, 2009

The Book of Mormon

I love the Bible.  It is the word of God.  I am also thankful for the Book of Mormon.  It is also the word of God.  How much poorer I would be without passages such as these:

   I will go and do the things which the Lord hath commanded, for I know that the Lord giveth no commandments unto the children of men, save he shall prepare a way for them that they may accomplish the thing which he commandeth them ( 1 Nephi 3:7).


   Adam fell that men might be; and men are, that they might have joy ( 2 Nephi 2:25).


   For we labor diligently to write, to persuade our children, and also our brethren, to believe in Christ, and to be reconciled to God; for we know that it is by grace that we are saved, after all we can do ( 2 Nephi 25:23).


   Wherefore, ye must press forward with a steadfastness in Christ, having a perfect brightness of hope, and a love of God and of all men. Wherefore, if ye shall press forward, feasting upon the word of Christ, and endure to the end, behold, thus saith the Father: Ye shall have eternal life ( 2 Nephi 31:20).


   For the natural man is an enemy to God, and has been from the fall of Adam, and will be, forever and ever, unless he yields to the enticings of the Holy Spirit, and putteth off the natural man and becometh a saint through the atonement of Christ the Lord, and becometh as a child, submissive, meek, humble, patient, full of love, willing to submit to all things which the Lord seeth fit to inflict upon him, even as a child doth submit to his father ( Mosiah 3:19).


   For how knoweth a man the master whom he has not served, and who is a stranger unto him, and is far from the thoughts and intents of his heart? ( Mosiah 5:13)


   And behold, he shall be born of Mary, at Jerusalem which is the land of our forefathers, she being a virgin, a precious and chosen vessel, who shall be overshadowed and conceive by the power of the Holy Ghost, and bring forth a son, yea, even the Son of God.
   And he shall go forth, suffering pains and afflictions and temptations of every kind; and this that the word might be fulfilled which saith he will take upon him the pains and the sicknesses of his people.
   And he will take upon him death, that he may loose the bands of death which bind his people; and he will take upon him their infirmities, that his bowels may be filled with mercy, according to the flesh, that he may know according to the flesh how to succor his people according to their infirmities ( Alma 7:10-12).


    Yea, and cry unto God for all thy support; yea, let all thy doings be unto the Lord, and whithersoever thou goest let it be in the Lord; yea, let all thy thoughts be directed unto the Lord; yea, let the affections of thy heart be placed upon the Lord forever.
   Counsel with the Lord in all thy doings, and he will direct thee for good; yea, when thou liest down at night lie down unto the Lord, that he may watch over you in your sleep; and when thou risest in the morning let thy heart be full of thanks unto God; and if ye do these things, ye shall be lifted up at the last day ( Alma 37:36-37).


   And now, my sons, remember, remember that it is upon the rock of our Redeemer, who is Christ, the Son of God, that ye must build your foundation; that when the devil shall send forth his mighty winds, yea, his shafts in the whirlwind, yea, when all his hail and his mighty storm shall beat upon you, it shall have no power over you to drag you down to the gulf of misery and endless wo, because of the rock upon which ye are built, which is a sure foundation, a foundation whereon if men build they cannot fall ( Helaman 5:12).


   And if men come unto me I will show unto them their weakness. I give unto men weakness that they may be humble; and my grace is sufficient for all men that humble themselves before me; for if they humble themselves before me, and have faith in me, then will I make weak things become strong unto them ( Ether 12:27).


    Behold, I would exhort you that when ye shall read these things, if it be wisdom in God that ye should read them, that ye would remember how merciful the Lord hath been unto the children of men, from the creation of Adam even down until the time that ye shall receive these things, and ponder it in your hearts.
   And when ye shall receive these things, I would exhort you that ye would ask God, the Eternal Father, in the name of Christ, if these things are not true; and if ye shall ask with a sincere heart, with real intent, having faith in Christ, he will manifest the truth of it unto you, by the power of the Holy Ghost.
   And by the power of the Holy Ghost ye may know the truth of all things ( Moroni 10:3-5).

Wednesday, May 20, 2009

psexec Computer Trick

From my computer, I
can open a cmd console screen with a message on it on another computer using psexec
Here's how:

I need to already
have administrative privileges on the target computer.
  • psexec needs to be
    installed on my computer.
  • I create a batch
    file that looks like this: 
    @echo OFF
    echo Tell me if you got
    this.
    echo.
    pause
    del %0
    (The last line is the batch file
    "self-destruct" command.)
  • I open a command
    window, and type  psexec \targetcomputernameorIP -i -c
    "C:pathtofile.bat"

    The -i switch runs
    the process interactively with the logged on user.  The -c switch copies
    the file to that computer before running it.

    Monday, May 11, 2009

    Step-through VBscript Debugging

    First of all, let me
    say at the outset that if there is any way at all you can use Windows Powershell
    instead of VBscript, do it.  Powershell is the future of Windows
    scripting.



    But we all have to
    go back and fix things from the past sometimes, and when we do it's nice to have
    some tools.



    One of the great
    tools I use is Notepad++, a
    free and highly configurable text editor for Windows.



    You can configure
    Notepad++ to open up a debugging program to step through the file you've
    currently got open.  First you have to edit your
    %APPDATA%Notepad++shortcuts.xml file.  In the <UserDefinedCommands>
    element, add this line:

    <Command name="Debug VBscript" Ctrl="no"
    Alt="no" Shift="no" Key="0">wscript.exe //D //X
    &quot;$(FULL_CURRENT_PATH)&quot;</Command>


    This will add a command to the Notepad++ "Run" menu, that will execute the currently saved
    version of your open file with wscript.exe, with the //D switch to tell it to
    debug if it encounters any errors, and the //X switch to immeditely throw an
    error at the beginning of execution.



    Next, what debugger
    should you use?  Often you can get Microsoft Script Debugger to come up,
    but if it all possible, see if you can use Microsoft Script Editor. 
    Microsoft Script Editor comes with Microsoft Office; I can find mine in
    %PROGRAMFILES%Microsoft OfficeOFFICE11.  It's called
    MSE7.EXE.



    It took a little
    doing to figure out how to get it to come up as a debugger.  I think this
    registry edit should do the trick.  Create a .reg file with these contents
    and merge it with your registry [Disclaimer: DO ONLY AT YOUR OWN RISK! 
    Making a mistake modifying the registry can crash your
    computer]:



    REGEDIT4


    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftMachine Debug
    ManagerJITDebuggingEngines{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}]
    @="Script
    Only"


    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftMachine Debug
    ManagerJITDebuggingEngines{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}{000C1227-0000-0000-C000-000000000046}]
    @=""
    "Remote"=dword:00000001


    For more help check here:

    http://support.microsoft.com/kb/308364

    Wednesday, May 6, 2009

    Windows Administration From My Workstation

    I've always wanted to know how to bring up a command console or Explorer window as an administrator with full privileges, instead of having to remote login to the server.  This link tells you how:
    http://support.microsoft.com/kb/225035


    Here's how to bring up a "remote" command shell on another Windows computer (you already need to have administrative privileges on it):
    http://computer-vet.com/weblog/2008/01/28/remote-command-line-on-windows.html


    I've already installed SQL Server tools on my workstation, so I can manage my SQL Server from there.  But today I figured out how to install the Active Directory MMC snap-in at my workstation.  The only catch is figuring out how to run it with administrator privileges (see above link.)  The following link explains how to install the AD snap-in at your local workstation:
    http://forums.techarena.in/active-directory/694630.htm


    After you run MMC and add the Active Directory Users & Computers snap-in, you can save the mmc console as an .msc file, move it to %windir%system32, and create a batch file to run it with one click from your start menu:


    @ECHO OFF
    runas /user:DOMAINadministrator "mmc AD.msc"


    (Thanks, scripting guys.)