ExpandEnvironmentStrings

  • Thread starter Thread starter Franck
  • Start date Start date
F

Franck

Hi
Know how to get Environment paramaters through vbscript
Set WshShell = WScript.CreateObject("WScript.Shell")
strHomeshare = WshShell.ExpandEnvironmentStrings("%HOMESHARE%")

I'm trying to get the same value in VB using the following function but
can't figure out how to use it :

Private Declare Function ExpandEnvironmentStrings Lib "kernel32" Alias
"ExpandEnvironmentStringsA" (ByVal lpSrc As String, ByVal lpDst As
String, ByVal nSize As Long) As Long

Help please.
 
Franck said:
Know how to get Environment paramaters through vbscript
Set WshShell = WScript.CreateObject("WScript.Shell")
strHomeshare = WshShell.ExpandEnvironmentStrings("%HOMESHARE%")

I'm trying to get the same value in VB using the following function but
can't figure out how to use it :

Use 'Environment.ExpandEnvironmentVariables' instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top