none
How to Run a Batch File Before Logging on to Your Computer

    General discussion

  • Ok here's my dilemma:

    I resently reset the rights of my Windows XP the wrong way. Now I'm unable to Logon to my accounts (Administrator as well). It logs me out as soon as I enter.

    I found out that resetting the rights and permissions could be done using a batch file.

    Unfortunately I haven't found a way to reset the permissions and rights before it attempts to log me in.

    My question:

    Is there a way to execute a batch file before loging on?

    Next question:

    Can an example be shown so I can make one?

    Thanks,

    KraZ

     
    Thursday, February 28, 2013 2:59 AM

All replies

  • If you do not have any user with some rights, I can't see this being done?

    The script it self, will need rights to execute the commands.

    Maybe you should direct your problem to the Windows Forum, and hear if they can help you regain your rights.


    Best Regards
    Claus Codam
    Consultant, Developer
    Coretech - Blog

    Thursday, February 28, 2013 3:05 AM
  • The script itself will reset the rights, just need it to run before logon

    Thursday, February 28, 2013 3:07 AM
  • This is the Batch I want to run before it attempts to log on. Just need a way to run it before attempted logon.

    @echo off


    title Resetting ACLs...

    cd /d "%ProgramFiles%\Windows Resource Kits\Tools"

    echo.

    echo Resetting ACLs...

    echo (this may take several minutes to complete)

    echo.

    echo ==========================================================================

    echo.

    echo.

    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f

    echo.

    echo.

    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f

    echo.

    echo.

    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f

    echo.

    echo.

    echo System Drive...

    subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f

    echo.

    echo.

    Thursday, February 28, 2013 3:10 AM
  • I still don't see this happening, without an users account that still have access.

    If you didn't need an user account with access, you could do this go get access to any computer.


    Best Regards
    Claus Codam
    Consultant, Developer
    Coretech - Blog

    Thursday, February 28, 2013 10:07 AM
  • Hi,


    Since your operation system is Windows XP, I suggest you post it in Windows XP Service Pack 3 (SP3) forum for more help.


    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.  Thank you for your understanding.


    Thanks,


    Vincent Wang
    TechNet Community Support

    Friday, March 01, 2013 5:59 AM
    Moderator