corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Need to convert a batch file into VBScript » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Richie

posted on 18th Oct 07 at 23:05

Manged to get it working using this in the end (didnt need groove or onenote either)

Dim oShell

Set oShell = WScript.CreateObject ("WSCript.shell")

oShell.run "cmd /K""netsh firewall add allowedprogram program= ""C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE"" ""Microsoft Office Outlook 2007"" profile = ALL & exit """""""

Set oShell = nothing


James

posted on 18th Oct 07 at 22:47

objShell isnt a function its an object, pretty sure those last two lines should be objShell.Sleep and objShell.Quit too.

But apart from that, providing there aren't any syntax errors, the above should work.

[Edited on 18-10-2007 by James]


Dom

posted on 18th Oct 07 at 22:42

look at the objshell function under VBScript, im not 100% clued up but something like -

code:

Option Explicit
Dim objShell
Dim strPath as String

strPath = "%ProgramFiles%\Microsoft Office\Office12"
Set objShell = CreateObject("WScript.Shell")

objShell.Run("netsh firewall add allowedprogram program = " & strPath & "\GROOVE.EXE name = 'Microsoft Office Groove' mode = ENABLE profile = ALL")
Wscript.Sleep 1500
WScript.Quit


Richie

posted on 18th Oct 07 at 19:38

Scaredy cats


Richie

posted on 17th Oct 07 at 19:10

Adds a bunch of firewall rules on vista....

@echo off
echo Adding Windows Firewall Rules......
echo.
echo.
echo.
pause
set OFPATH="%ProgramFiles%\Microsoft Office\Office12"
netsh firewall add allowedprogram program = %OFPATH%\GROOVE.EXE name = "Microsoft Office Groove" mode = ENABLE profile = ALL
netsh firewall add allowedprogram program = %OFPATH%\ONENOTE.EXE name = "Microsoft Office OneNote" mode = ENABLE profile = ALL
netsh firewall add allowedprogram program = %OFPATH%\OUTLOOK.EXE name = "Microsoft Office Outlook" mode = ENABLE profile = ALL
ECHO Firewall Rules Added Sucessfully......
pause
exit


Dom

posted on 17th Oct 07 at 18:36

just google for the batch file equivalent in VBScript, it's fairly simple - though if you need to output anything then a message box is about as far as it goes unless you're going to embedded it into a HTML page in which case the worlds your oyster.

what does the batch file do anyways?


Richie

posted on 17th Oct 07 at 18:02

But im a dribbler when it comes to VB script.

Can anyone help?