Click here to Skip to main content
15,902,715 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUsing %windir% in File.copy Pin
Ghost_80717-Aug-09 11:03
Ghost_80717-Aug-09 11:03 
AnswerRe: Using %windir% in File.copy ... oppps VB Pin
Adam R Harris17-Aug-09 11:29
Adam R Harris17-Aug-09 11:29 
AnswerRe: Using %windir% in File.copy Pin
Sonhospa17-Aug-09 11:36
Sonhospa17-Aug-09 11:36 
AnswerRe: Using %windir% in File.copy Pin
Ghost_80717-Aug-09 12:03
Ghost_80717-Aug-09 12:03 
GeneralRe: Using %windir% in File.copy Pin
Dave Kreskowiak17-Aug-09 14:34
mveDave Kreskowiak17-Aug-09 14:34 
GeneralRe: Using %windir% in File.copy Pin
Ghost_80718-Aug-09 3:06
Ghost_80718-Aug-09 3:06 
GeneralRe: Using %windir% in File.copy Pin
Dave Kreskowiak18-Aug-09 4:20
mveDave Kreskowiak18-Aug-09 4:20 
GeneralRe: Using %windir% in File.copy Pin
Ghost_80718-Aug-09 6:44
Ghost_80718-Aug-09 6:44 
this is what i have so far
Dim regex As RegularExpressions.Regex
regex = New RegularExpressions.Regex("%{1}(?'EnvName'\w{1,32})%{1}")
Dim found As RegularExpressions.MatchCollection = regex.Matches(ProgramPath)
For Each aMatch As RegularExpressions.Match In found
    Console.WriteLine(aMatch.ToString)
    Console.WriteLine(Environment.GetEnvironmentVariable(aMatch.ToString.Replace("%", "")))
Next

which works like a champ
this "%windir%%programfiles%%systemroot%" for ProgramPath
gives me
%windir%
C:\WINDOWS
%programfiles%
C:\Program Files
%systemroot%
C:\WINDOWS


i am working on trying to get the regex to replace the %windir% with the GetEnvironmentVariable
but so far no luck. the input can be "%windir%\test"
most of the replace examples i find are for phone numbers and the like.
thank you again for your help.
GeneralRe: Using %windir% in File.copy Pin
Ghost_80718-Aug-09 9:53
Ghost_80718-Aug-09 9:53 
QuestionAutomatically starting VB 6 application at Windows Start Up Pin
RyJaBy17-Aug-09 7:02
RyJaBy17-Aug-09 7:02 
AnswerRe: Automatically starting VB 6 application at Windows Start Up Pin
Dave Kreskowiak17-Aug-09 8:07
mveDave Kreskowiak17-Aug-09 8:07 
QuestionHow to print page with Visual Basic 2008? Pin
Mohamed_Khalil17-Aug-09 6:31
Mohamed_Khalil17-Aug-09 6:31 
AnswerRe: How to print page with Visual Basic 2008? Pin
Henry Minute17-Aug-09 7:06
Henry Minute17-Aug-09 7:06 
QuestionAdding a Positive Double to Negative Double Pin
KeithF17-Aug-09 3:43
KeithF17-Aug-09 3:43 
AnswerRe: Adding a Positive Double to Negative Double Pin
Luc Pattyn17-Aug-09 4:12
sitebuilderLuc Pattyn17-Aug-09 4:12 
GeneralRe: Adding a Positive Double to Negative Double Pin
KeithF17-Aug-09 4:16
KeithF17-Aug-09 4:16 
QuestionCanceling a ThreadPool thread that's being blocked by a .NET method Pin
Brandon D. Legault17-Aug-09 3:39
Brandon D. Legault17-Aug-09 3:39 
AnswerRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Dave Kreskowiak17-Aug-09 4:28
mveDave Kreskowiak17-Aug-09 4:28 
GeneralRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Brandon D. Legault17-Aug-09 4:41
Brandon D. Legault17-Aug-09 4:41 
GeneralRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Dave Kreskowiak17-Aug-09 6:54
mveDave Kreskowiak17-Aug-09 6:54 
GeneralRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Brandon D. Legault17-Aug-09 7:43
Brandon D. Legault17-Aug-09 7:43 
AnswerRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Luc Pattyn17-Aug-09 14:47
sitebuilderLuc Pattyn17-Aug-09 14:47 
QuestionProject Size ? Pin
Paramu197317-Aug-09 3:13
Paramu197317-Aug-09 3:13 
AnswerRe: Project Size ? Pin
Johan Hakkesteegt17-Aug-09 3:27
Johan Hakkesteegt17-Aug-09 3:27 
QuestionHelp with automated VB script? Pin
mukkil17-Aug-09 0:27
mukkil17-Aug-09 0:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.