Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: "CACLS C:\J\K\L\M" Sets %ERRORLEVEL% to 267, why and what.  (Read 5731 times)

0 Members and 1 Guest are viewing this topic.

ALAN_BR

    Topic Starter


    Hopeful

    Thanked: 5
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 7
    "CACLS C:\J\K\L\M" Sets %ERRORLEVEL% to 267, why and what.
    « on: July 05, 2010, 02:27:20 AM »
    I really would like to find out what is meant by 267, and all the other numbers or bit patterns that can be generated by CACLS

    I know that if I have created the path C:\J\K\
    and then the file C:\J\K\L
    it is not possible for there to be any C:\J\K\L\M, and that gives the number 267

    I also know that if L is the name (which I can see) of my daughter's profile,
    there is no way I can detect the contents of her profile,
    and CACLS cannot see any further than me - it too has no access,
    but it gives a different number which is 5.

    I would like a script that can handle an arbitrary list of folder paths,
    and for each path test whether that path exists or not,
    and if it does not exist to determine whether there is a fundamental blockage of access  somewhere along that "path".

    I wish to do this without needing write access to the folder paths.
    The test "IF EXIST" will only set %ERRORLEVEL% to only 0 or 1,
    but CACLS has given me a tantalising glimpse of other numbers that could be useful if I knew more.

    Supplementary Question - General Interest :-

    I always thought of Command.com as using a byte (8 bit) value for the errorlevel.

    I welcomed the CMD.EXE which gives a numerical value to a new %ERRORLEVEL%,
    and avoids the tedious necessity to run up to 256 tests of the form
    if errorlevel 1 ... action
    if errorlevel 2 ... action
    etc
    if errorlevel 255 ... action.

    I am surprised that %ERRORLEVEL% can become 267.
    Does this indicate that %ERRORLEVEL% is now quoted as an octal representation of an 8 bit (byte) value with illegal omission of the leading zero,
    or is it now a 16bit/32bit word value?

    Regards
    Alan

    Salmon Trout

    • Guest
    Re: "CACLS C:\J\K\L\M" Sets %ERRORLEVEL% to 267, why and what.
    « Reply #1 on: July 05, 2010, 09:30:39 AM »
    or is it now a 16bit/32bit word value?

    32-bit signed integers.

    ERROR_DIRECTORY 267 (0x10B) The directory name is invalid.

    List here

    http://msdn.microsoft.com/en-us/library/ms681382(VS.85).aspx

    ALAN_BR

      Topic Starter


      Hopeful

      Thanked: 5
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 7
      Re: "CACLS C:\J\K\L\M" Sets %ERRORLEVEL% to 267, why and what.
      « Reply #2 on: July 05, 2010, 02:40:54 PM »
      Thank you for the link.  Very informative and relevant to CACLS.

      I had been looking for CACLS ERRORLEVEL and got far too many hits,
      but when I restricted the search to  the site msdn.microsoft.com I got zero results.

      I have now given up on CACLS for assisting with my current needs.

      For the sake of a more suitable topic title I am starting over again, and look forward to any advice you can offer at :-
      http://www.computerhope.com/forum/index.php/topic,106959.0.html
      Title
      How to test if "MD C:\A\B\C\D\E\F" will succeed - WITHOUT executing it.

      N.B. THAT topic was disrupted by the spelling check which suggested that "status quo" should be "status quot" - so I googled "quo" and it agreed with me, and had far fewer results for "quot" - and when I clicked a couple, one of them offered me "pharmacy products" and the other gave a pop-up warning that I was under a malware attack and needed a scan.
      I could not switch to any other tabs, and chose not to click the cancel button on the pop-up.  Google had not given any warnings about them.
      Task Manager had no problem killing the Firefox.exe process, and when I re-launched Firefox it re-opened all the Tabs and I cancelled the last two naughty ones before they loaded.  My new topic appeared intact so I posted - and I have now corrected a spelling mistake in the title which could have been the result of the unwanted pop-up.

      Sorry, I will not be returning to see answers until tomorrow.
      I am now going off-line to burn midnight oil whilst I check on all my system events and security logs to see if there is anything unusual as a result of that pop-up.
      Internet surprises are such fun ! ! !

      Regards
      Alan