Hi Guys I'm new to VSscripts, I want to make a script which make a folder on current logged-in user's Desktop
What I had tried is:
------------------------------------------------------------------------
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 "Don't be Shy." & 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 strInfo
strInfo = objNet.UserName & vbCRLF
strDirectory = "C:\Documents and Settings\" & strInfo & "Desktop\Data"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder(strDirectory)
Set objNet = Nothing 'Destroy the Object to free the Memory
-----------------------------------------------------------------------------------------------
The Bold Line has problem but dont know whats that, Kaz i tried on other folders(without strInfo) and it worked
Hi. Maybe it will work better without the newline character
strInfo = objNet.UserName & vbCRLF
like this
strInfo = objNet.UserName