|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBscript help!
Hi, I'm trying to create a simple script that checks the system time and names a folder after it, and then calls an application to run. I'm in the initial stages right now, learning how to create a folder. I found the below code on MS's website, but when I run it using CScript c:\New Folder is not created! Please help
Function CreateFolderDemo Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateFolder("c:\New Folder") CreateFolderDemo = f.Path End Function |
|
#2
|
||||
|
||||
|
How are you calling the function?
i.e. show your code |
|
#3
|
|||
|
|||
|
Don't laugh, but I don't think I am. That's the entire body of my vbs file. I would appreciate knowing how to call a function.
I then run the file on the command prompt with cscript //d backup.vbs |
|
#4
|
|||
|
|||
|
Wait, there we go. I added a call CreateFolderDemo() and it works fine now.
thank you |
|
#5
|
||||
|
||||
|
Here is a sample
Code:
Function CreateFolderDemo()
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder("c:\success")
CreateFolderDemo = f.Path
End Function
Dim temp
temp = CreateFolderDemo()
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > VBscript help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|