Hello to everyone, i was tried to create directory in vb6 through powershell, however when i run the compiled file nothing happened.

Shell "cmd.exe /c Powershell: New-Item \?\C:\Windows \System32 -ItemType Directory"

and also i through CMD in vb6

Dim command As String
command = "md \?\C:\Windows \System32"
Shell "cmd.exe /c command"

Note that, there's space between \Windows and slash(this is intentional)
Any suggestions?

Shouldn't that be like this:

Dim command As String
command = "md \?\C:\Windows \System32"
Shell "cmd.exe /c " & command
commented: creates folder only system32 i think the problem is the space between the name and slash, do u think its possible to create folder like that? +0

ttst.png

This post has no text-based content.

Do you want a space after Windows?

commented: The problem from what i see is that, powershell using slash and question mark "\\?\" thats why cant be run in vb6, any ideas? +0

You commented it didn't work but didn't tell much more. Anyhow there are reasons it should not work. The #1 reason would be permissions or an ACL (access control list) restriction. As you are a programmer on Windows you must know about these topics. The restriction on the ACL has been around for a few decades. Example: https://www.techrepublic.com/forums/discussions/how-to-deny-create-folder-on-root-c/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.