Hi there...im the new member here and the beginner in vb application im from Malaysia...can u all show me the format of the vb scripts or the one example of vb scripts..Im really need it...
Thanks and Regards
why didn't you tried to search on Goo**e ?
Dim Fso, File, WshShell
Set WshShell = Createobject("Wscript.Shell")
Set Fso = CreateObject("Scripting.FileSystemObject") File = "c:\test.vbs"
WshShell.Run "runas /user:USER", 0, True
If Fso.FileExists(File) Then Fso.DeleteFile(File) End If
For Each File In Fso.GetFolder("C:\TestFolder")
The other way, which was mentioned earlier, would be to use VBScript as a gateway to the Windows Scripting Host . This would give you the ability to control some things on the system, such as opening, reading and writing files, or sending up msgbox's or inputbox's for user input. VBScript has also been known to be useful in automating Office Products, such as word, excel, or an Access Database.
Depending upon your want/need, would depend on how you would go about writing the VBScript. You would need to know and use HTML (Web page language) in order to effectively use VBScript in your web site. If you want to use it on the system, then it's as simple as loading notepad, and naming the file with a .vbs extention.
Since VBScript pretty much gets most of it's power from objects, you need to create and manipulate the objects you want to fiddle with. Everything is an object, so you need to ensure that you create the object relevant to what you are doing. Let's quickly make a system side VBScript that does nothing more than takes info from the user, and displays it. So first, click start, click run, and type in "notepad" without the quotes. Once notepad is open, put this in the notepad window:
userinput = inputbox("Type A Message")
Now click file, save as, click "Desktop" on the left, and change "Save as type" from "Text Documents (*.txt)" to "All Files". Then, type in the "File Name" box "try.vbs" and click save.
Now on your desktop you should have a file called "try.vbs" that has a white icon with a blue scroll on it. Double click it, and it will ask you for a message..... now to the code.
The first line dimensions a variable. Dimensioning is the process where we tell the computer that we are going to use a variable, with the name we give it. In our example, the first line tells the computer that we want a variable called userinput. The next line, basically says load a box that the user can type in, and display the message "Type A Message", and save the information that the user typed in the box in the variabled called "userinput". The third line simply says "load a box, with an OK button, and display the information that is stored in the userinput variable". You should understand all of that, but if you don't, then you should seriously consider reading a tutorial on VBScript from the ground up. You have to start somewhere, and a good place is a Good Tutorial. Let me know how it goes.