dir command not working in virtualbox

p g 20 Reputation points
2023-10-02T11:57:19.3866667+00:00

I am running windows 11 in oracle virtualbox 6.1.38

when I open a command prompt and type "dir" it woks as expected, but when I try to add switches ie "dir /s" I get this error: (also does this in administrator mode)

dir : Cannot find path 'C:\s' because it does not exist.
At line:1 char:1
+ dir \s
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\s:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommandt
Microsoft Teams Phone
Microsoft Teams Phone
Teams Phone enables call-control and Private Branch Exchange (PBX) capabilities in the Microsoft 365 cloud with Microsoft Teams.
155 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 44,656 Reputation points
    2023-10-02T12:10:19.81+00:00

    when I open a command prompt

    You are on a wrong track. You didn't opened a simple CommandBox, but a PowerShell box.

    In PowerShell knowns "dir" as alias for the CmdLet "Get-CildItem", but that alias don't support switches like the DOS command dir.

    See https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.3

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.