Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual basic Shell %USERPROFILE%

Tags:

shell

I'm trying to make a folder with an visual basic program using Shell

           Shell("md %USERPROFILE%\AppData\Roaming\projectfiles2")

It doesn't understand %USERPROFILE% though and that's a problem.

How can I make the program understand that %USERPROFILE% means "C:\Users\User\"?

Sorry I'm a noob at visual basic still.

like image 211
dszafasdf Avatar asked Jan 24 '26 17:01

dszafasdf


1 Answers

Try to execute from shell: mkdir %USERPROFILE%\AppData\Roaming\projectfiles2 or Write a new script in visual basic

Dim user() as string
Form1_load...
user=My.Computer.User.Name.split("\")
shell("cmd.exe /c mkdir " & user(1) & " \AppData\Roaming\projectfiles2")

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!