how do i run/execute files with a .vbs extention ?

hi..
i have a file with a .vbs extention which is wrongly associated with ms media player. i wanted to know which program to associate with it to run the .vbs file.

thanks
vikky
vikky999Asked:
Who is Participating?
 
mehmanConnect With a Mentor Commented:
A file with the extension VBS is a VBScript file It can be run in the following ways
1. cscript.exe <filename>
2. wscript <filename>

Hope this answers your question

Regards
0
 
slink9Commented:
It is vbscript and should be associated with visual basic.  Do you know the source of this file?  Do you know that it is not a virus?
If you want to associate it with visual basic you can open explorer, browse to that file, shift-right-click it, and select Open With.
0
 
vikky999Author Commented:
the file that i have isnt a virus. its a virus buster..well not exactly but still . infact i did try to open it in vb but i got a zillion errors...any other software that runs a .vbs file?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
lyonstCommented:
Hi,

The file type is Visual Basic Script file (I assume it is not a virus).

It can be opened with Visual Basic as follows...

Its simple all you need to do is change the file association.

You can do this in several ways ..

Select an file - hold down the shift key and right click on it.  Choose open with and select the

application you now wish to use to view the file.

1. In Explorer or My Computer, select a file with a .vbs extension.
2. From your menu, choose View, then Options, then File Types.
3. Select VBS file, then click the Edit button.
4. When the Edit File Type dialog box opens, click New.
5. In the Action box, type Open in XXXXX ( xxxxx - whatever application you want to use).
6. Click the Browse button, and select your new application. It will appear in the
  dialog box for  "Application used to perform action" and will probably
  be listed as:"C:\Program Files\VB6.exe"
7. Click o.k., then the close button.

Cheers,

T.
0
 
lyonstCommented:
Also,

Just associate it with notepad and open it and see what it looks like.

T.
0
 
kahleanCommented:
a vbs script contains visual basic script which can be executed by the program specific by the vbs file. The only way is that you have to know it better.
0
 
kahleanCommented:
you can try to invoke this vbs file by activitaing manual using dos. You can identify any exe file that might use to trigger the vbs file, just type the <program name> <vbs file name> ..

Example


cscript newsletter.vbs

my assumption is base on my experinece of using vbs file in sending newsletter, wherby the csript program will activate this newsletter vbs file. Hope it could give you some hint here.

Regarsds
0
 
kahleanCommented:
i have miss your previous comment. For vbs file you dont need and file association to it. Infact specific executable program will invoke specific vbs file regardsless of its association, so it hard to tell what program is needed to run the vbs file. You can remove the vbs file association and it will still runs fine.

Regards
0
 
vikky999Author Commented:
i have a 15kb vbs file that i just downloaded from the net...can somebody take a look at it and tell me what to do with it ?..wait..ill send a little bit
Option Explicit

Dim Message, Title, Text1
Dim fso, WSHSHell, exefile, htmlfile
Dim tStart, tElapsed
Dim timeout1, timeout2, timeout3
Dim state(255)
Dim key(255)
Message = "Enter the name of the executable to wrap in Godmessage IV"
Title = "6IT's Godmessage IV Creator v0.4"
Text1 = "Sorry, user input was canceled"
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
Const ForReading = 1
Const ForAppending = 8
exefile = InputBox(Message,Title,"onz.exe", 4000, 3000)
If exefile = "" Then
     WScript.Echo Text1
     WScript.Quit()
ElseIf exefile = "onz.exe" Then

     If fso.FileExists(exefile) Then
          GMCreate()
     Else
          WScript.Echo "File Doesn't Exist!"
          WScript.Quit()
     End If
Else
     If fso.FileExists(exefile) Then
          fso.CopyFile exefile, "onz.exe", True
          GMCreate()
     Else
          WScript.Echo "File Doesn't Exist!"
          WScript.Quit()
     End If
End If
WScript.Echo "Success! and Elapsed time=" & tElapsed & " seconds"
WScript.Quit()

Sub GMCreate()
PrptHtmlFile()
PrptTimeouts()  



-----8888888---there was more but i cut it----888888---

any suggestions
??

0
 
NavidCommented:
mehman:
Unlock the question. You are not even close to the answer.
vikky999:
Please reject the answer if you want a real answer from us!
I think I can help you..
0
 
vikky999Author Commented:
hey navid..yep i need an answer anyway
although i found the creator
thanks

please help
0
 
NavidCommented:
Excellent..
If running the pack:
1. cscript.exe <filename>
2. wscript <filename>
could help,
I appologize to mehman.
Glad you solved your problem..
Good luck
Navid
0
 
vikky999Author Commented:
no no...it didnt work i gave the points to mehman by mistake....could you help me please
0
 
kahleanCommented:
even though if that work, that was taken from my previous comment.
0
 
kahleanCommented:
vikky999, if you wish to solve this matter, post a question in CS for their support.
0
 
kahleanCommented:
vikky999, as i had mention earlier, no matter you wanted to execute the vb script manually or automatically by a program you dont have to be worry about the file association, a vbs file can be executed no matter what fiel association it is.
0
 
MoondancerCommented:
Client accepted and closed this in error, I will refund these points.  Here is the link to the question requesting this.

for navid only....same vbs script???

http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20141328

Moondancer
Community Support Moderator @ Experts Exchange
0
 
MoondancerCommented:
These points have been refunded.

Moondanced
Community Support Moderator @ Experts Exchange
0
 
kahleanCommented:
i think the exe file that is needed to run the vbs file might be onz.exe as what my assumption base on the vbs codes. Just type onz <vbs file name>
0
 
vikky999Author Commented:
ok kahlean ill try
thanks mr moondancer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.