Advertisement

10.09.2008 at 05:41AM PDT, ID: 23800580
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

Need a vbScript to change HOSTS file  when vpngui.exe is running and delete the line when vpngui.exe is stopped.

Asked by lk-data in VB Script

Tags:

Im a total new to vbscript.!

Need to delete line in HOSTS file when vpngui.exe is stopped.
I have made the vbscript so far, just can't get it to delete the line when vpngui.exe is stopped.!





Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
Const ForReading = 1 ' Open file read only
Const ForWriting = 2 ' Open file read write
 
Dim objFso, objFile, strFileName, strText, strNewText
 
' It might be nice at some point to get this via the environment variables
strFileName = "C:\windows\system32\drivers\etc\hosts" 
 
Set objFso = CreateObject("Scripting.FileSystemObject")
 
' Open the File and read into string
Set objFile = objFso.OpenTextFile(strFileName, ForReading) 
strText = objFile.ReadAll 
objFile.Close ' close the file
 
' Create a regular expression
Dim re
Set re = New RegExp 
re.Pattern = ".*srv01\.office\.local.*\n" 
re.IgnoreCase = True
re.Global = True
 
' Add the entry 
strNewText = re.Replace(strText, "") 
 strNewText = strNewText + "192.168.30.10    srv01.office.local" 
 
' Write out file (deletes old file)
Set ObjFile = objFSO.OpenTextFile(strFileName, ForWriting) 
objFile.WriteLine strNewText ' Write out the string contents
objFile.Close
 
' Flush the DNS Cache so change will take effect
Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run "ipconfig /flushdns"
MsgBox("Starter forbindelse til serveren - Vent venligst")
WshShell.Run "ping -n 16 127.0.0.1 >NUL"
WshShell.Run "C:\WINDOWS\system32\mstsc.exe /v:srv01.office.local /f"
[+][-]10.09.2008 at 06:05AM PDT, ID: 22677890

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 06:26AM PDT, ID: 22678107

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 06:31AM PDT, ID: 22678147

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 06:44AM PDT, ID: 22678273

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10.09.2008 at 06:54AM PDT, ID: 22678365

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 06:56AM PDT, ID: 22678382

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 07:07AM PDT, ID: 22678514

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 07:29AM PDT, ID: 22678738

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 08:48AM PDT, ID: 22679594

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 10:34PM PDT, ID: 22684498

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.09.2008 at 11:39PM PDT, ID: 22684690

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 12:14AM PDT, ID: 22684808

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 01:21AM PDT, ID: 22685080

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 02:09AM PDT, ID: 22685264

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 04:18AM PDT, ID: 22685821

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: VB Script
Tags: VBScript
Sign Up Now!
Solution Provided By: lk-data
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628