runas administrator from cmd, error RUNAS ERROR 1327 Logon failure


  1. Posts : 7
    Windows 7 x64
       #1

    runas administrator from cmd, error RUNAS ERROR 1327 Logon failure


    Hello,

    Recently I have installed on a Virtual Machine Windows 7 so I can run automated builds on it with Jenkins.
    The problem comes here : I need to launch a .bat script from cmd, but as an administrator.When I try to do that, I get the error :
    RUNAS ERROR: Unable to run - *path to my file*.

    1327:Logon failure: user account restriction. Possible reasons are blank passwords not allowed, log on hour restrictions, or a policy restriction has been enforeced.
    I have been looking on the internet and found here a solution, but sadly, I do not have
    HKLM\System\CurrentControlSet\Control\Lsa\limitblankpassworduse

    Would be there any way I can run my script, remotely, as an administrator?

    Thank you!
      My Computer


  2. Posts : 708
    Windows 7 x64
       #2

    This require you to clearly indicate which folder is that file.bat come from.

    cmd.exe C:\Win7\temp\file.bat

    It require the full path name.

    Hence you need these steps.
    1. Touch on the WIN key.
    2. in the bottom where you need to input cmd.exe C:\Win7\temp\file.bat
    3. This will show on the top.
    4. Right-click and select Run as administrator

    In this way, you are in the administrator mode.
      My Computer


  3. Posts : 2,445
    Windows 7 Ultimate x64
       #3

    If that key don't exists of course you have to create it, and give the proper value (non existent values assume a default).

    But something else bothers me much more. An administrator account without a password is a very serious mistake. A better solution is to give a it password, so you gain security too.
    Yet another possibility, with security implications, is to run Jenkins with an administrator account instead of a limited one, so you don't even bother with runas.
      My Computer


  4. Posts : 708
    Windows 7 x64
       #4

    Alejandro85 said:
    If that key don't exists of course you have to create it, and give the proper value (non existent values assume a default).

    But something else bothers me much more. An administrator account without a password is a very serious mistake. A better solution is to give a it password, so you gain security too.
    Yet another possibility, with security implications, is to run Jenkins with an administrator account instead of a limited one, so you don't even bother with runas.
    :
    RUNAS ERROR: Unable to run - *path to my file*.

    1327:Logon failure: user account restriction. Possible reasons are blank passwords not allowed, log on hour restrictions, or a policy restriction has been enforeced.
    Most likely, Logon failure due to password, as Alejandro85 mentioned.
    Password cannot be Null, empty, blank, etc.

    Playing on Registry require some knowledge, as 1 wrong move &or location, the PC may crash, etc;
    Whatever changes made, it will take immediate effect, that is "Live".
    Something like this: create Dword: limitblankpassworduse (must be full, as it is)
    Then the Value: 0 or 1 (numeric digit) as it mean Yes or No &or True or False
    Advice you not to do this, as it is just an example.
      My Computer


  5. Posts : 7
    Windows 7 x64
    Thread Starter
       #5

    Thank you, guys, for your interest and help Funny, I managed to solve it in a tricky way (I'll explain at the end).

    Not to forget: looks like there was a 'limitblankpassworduse' file in regedit, but I did not see it at first ( I was looking for LimitBlankPasswordUse...)
    And regarding the security, there is no need for it, as the VM's location is on a linux server, inside VirtualBox (from Oracle) and only those with root privileges can acces it. ( so, I should not worry about security, right?)

    Now, the tricky way:
    1. Firstly, I had to disable UAC (start->UAC->lowest point possible)
    2. Secondly, I created a shortcut to that file and set it to run as an administrator (Properties -> Run as administrator)
    3. Instead of sending the path to the main file (.bat), I used the path to the shortcut (.lnk)


    Thank you again for your interest :)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 23:38.
Find Us