I don't know what went wrong, but I am not able to create a folder using the following code
Code:My.Computer.FileSystem.CreateDirectory(Environ("%UserProfile%") & "\Desktop\abc")
Printable View
I don't know what went wrong, but I am not able to create a folder using the following code
Code:My.Computer.FileSystem.CreateDirectory(Environ("%UserProfile%") & "\Desktop\abc")
You should write full path to directory. Here is simple code:
Code:Dim strUser As String
strUser = Environment.UserName
My.Computer.FileSystem.CreateDirectory("C:\Documents and Settings\" & strUser & "\Desktop\abc")
How about
Code:My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\abc")
Thanks KeyStone andBlagojce for helping me out
Yes keystone_paul, you're right.
I would have it in mind.
riteshtechie don't forget mark topic as resolved.