Continuing on FileSystemObject, Let us look at and example to extract the properties of a file. There are some new things introduced in this example
1. SUB. This is for a procedure. you can pass parameteres just like functions but just that you cannot return any values. I have put a simple procedure called Print, that takes a string as a parameter.
2. Parameteres. You can pass parameteres to a vbscript. Wscript.argument, is where you can see the list.
Sub Print(x) |
A few examples
C:\scripts>folder.vbs c:\53-Photos\ar-1.jpg Path C:\53-Photos\ar-1.jpg C:\scripts>folder folder.vbs Path C:\scripts\folder.vbs C:\scripts> |
You can try an example to show the file size in MB or GB depending on the size of the file. Or may be list an output like the DIR command.
No comments:
Post a Comment