views:

471

answers:

4

I'm writing pop-up's for a website (please don't get angry. It's an internal application that shows energy usage for different buildings and the specification is to alert the users every time they log on) and I have a VBScript script that will run at the end of the a Windows user's logon script.

Is there a command to run the script from within Visual Studio rather than having to drop to Windows Explorer. It's only a tiny thing but if I don't ask I'll never know!

I have VBScript script running at the end of some local builds and such but I'd like to be able to select the file, right-click, then run. But I don't seem to be able to.

+1  A: 

I don't believe so, but am hoping I am proved wrong.

Xetius
+1  A: 

To do what you want you need to extend the Visual Studio development environment by using an add-in. I don't know if the add-in you need already exists, but it is possible to write your own.

There is a list of popular add-ins here on Stack Overflow.

Martin Liversage
A: 

Try running cscript //X yourvbscript.vbs - it'll promt you for the debugging application. Select Visual Studio if have it installed.

Can do the same thing from VS but I don't remember at this moment ...

da_m_n
Did you read the question?
svinto
+2  A: 

You can create a macro that runs your script, either by invoking cscript/wscript or by using the scripting COM-component. You can then add the macro to the context menu.

Another way is to add it as en external tool on the tool menu.

svinto
I do this by adding cscript.exe as external tool. Value for Command field is 'C:\WINDOWS\system32\cscript.exe', for Arguments '//Nologo $(ItemPath)' and for InitialDir '$(ItemDir)' in the External tools dialog.
Uros Calakovic
I'm liking this one the most so far! Will try it tomorrow and accept if it works - thanks svinto.
David A Gibson
That's excellent I have an external tool that runs the script from the command bar. Thanks to you both!
David A Gibson