Good Morning,
I found a script to create the folder and I have modified it. This script create a folder in the server\User\"UserName". If the Folder is already created then it exists otherwise it creates the folder.
Dim objNet,objFSO, objFolder, strDirectory,test
On Error Resume Next
Set objNet = CreateObject("WScript.NetWork")
Set objNet = CreateObject("WScript.NetWork")
If Err.Number <> 0 Then 'If error occured then display notice
MsgBox "Create User Folder on Log On." & vbCRLF &_
"Do not press ""No"" If your browser warns you."
Document.Location = "UserInfo.html"
'Place the Name of the document.
'It will display again
End if
Dim UserName
'Get the Current User Name
UserName = objNet.UserName
strDirectory = "\\10.1.2.34\users\" & UserName
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Note If..Exists. Then, Else ... End If construction
If objFSO.FolderExists(strDirectory) Then
'Open the Folder if it's already created
'Set objFolder = objFSO.GetFolder(strDirectory)
'WScript.Echo strDirectory & " already created "
WScript.Quit
ELSE
Set objFolder = objFSO.CreateFolder(strDirectory)
WScript.Echo "Just created " & strDirectory
Set objNet = Nothing 'Destroy the Object to free the Memory
End If
If err.number = vbEmpty then
Set objShell = CreateObject("WScript.Shell")
objShell.run ("Explorer" &" " & strDirectory & "\" )
Else
WScript.echo "VBScript Error: " & err.number
End If
WScript.Quit
Set objNet = Nothing 'Destroy the Object to free the Memory
Thanks in Advance
Sincerely; Oscar