snyperj
asked on
Please help editing this .vbs
I am trying to use a script to create a subfolder that is named the same as the current user. The subfolder should be inside the users folder. I have a variable(vuser) holding the username, but I don't know how to concatenate the variable value into the AppFolder name. Please help, Thanks
I would also like this to create the \Apps\users folders too if they didn't already exist (they should always be there... but just in case they don't..)
Public fs
Public WshShell
Dim objNetwork
Dim vuser
Set objNetwork = CreateObject("WScript.Netw ork")
vuser = objNetwork.UserName
Set fs = CreateObject("Scripting.Fi leSystemOb ject")
AppFolder = "W:\Apps\users\" vuser
If fs.FolderExists(AppFolder) = False then
fs.CreateFolder AppFolder
End If
I would also like this to create the \Apps\users folders too if they didn't already exist (they should always be there... but just in case they don't..)
Public fs
Public WshShell
Dim objNetwork
Dim vuser
Set objNetwork = CreateObject("WScript.Netw
vuser = objNetwork.UserName
Set fs = CreateObject("Scripting.Fi
AppFolder = "W:\Apps\users\" vuser
If fs.FolderExists(AppFolder)
fs.CreateFolder AppFolder
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It doesn't create the parent folders (W:\Apps\users) if they don't exist... but I figured out how to do that (I think.)