Click here to Skip to main content
15,921,463 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generaldouble clicking on list view item or row in report view......... Pin
r i s h a b h s9-Dec-02 18:27
r i s h a b h s9-Dec-02 18:27 
GeneralRe: double clicking on list view item or row in report view......... Pin
RHYS9-Dec-02 21:29
RHYS9-Dec-02 21:29 
GeneralRe: double clicking on list view item or row in report view......... Pin
r i s h a b h s10-Dec-02 0:36
r i s h a b h s10-Dec-02 0:36 
GeneralRe: double clicking on list view item or row in report view......... Pin
RHYS10-Dec-02 1:42
RHYS10-Dec-02 1:42 
GeneralRe: double clicking on list view item or row in report view......... Pin
-- NA --10-Dec-02 6:59
-- NA --10-Dec-02 6:59 
GeneralRe: double clicking on list view item or row in report view......... Pin
r i s h a b h s10-Dec-02 21:22
r i s h a b h s10-Dec-02 21:22 
GeneralProgramatically change Folder Properties Pin
RHYS9-Dec-02 2:39
RHYS9-Dec-02 2:39 
GeneralEnvironnement variable with CreateProcess Pin
Jerome Conus9-Dec-02 2:35
Jerome Conus9-Dec-02 2:35 
Hi !!!

My app, in VB6, is creating a thread to launch a batch file and waiting on this thread to be finished.

Here is the code :

Dim l_lRet As Long
Dim l_lCreationFlags As Long
Dim l_recStartupInfo As STARTUPINFO
Dim l_recProcInfo As PROCESS_INFORMATION
Dim l_recProcAttr As SECURITY_ATTRIBUTES
Dim l_recThreadAttr As SECURITY_ATTRIBUTES

l_recProcAttr.nLength = Len(l_recProcAttr)
l_recThreadAttr.nLength = Len(l_recThreadAttr)
l_recStartupInfo.cb = Len(l_recStartupInfo)
l_recStartupInfo.dwFlags = STARTF_USESHOWWINDOW
l_recStartupInfo.wShowWindow = SW_NORMAL
l_lCreationFlags = HIGH_PRIORITY_CLASS

If CreateProcess(vbNullString, "C:\MyBatch.bat", l_recProcAttr, l_recThreadAttr, False, l_lCreationFlags, 0&, "C:\", l_recStartupInfo, l_recProcInfo) Then
    'Wait
    WaitForSingleObject l_recProcInfo.hProcess, INFINITE
    l_lRet = CloseHandle(l_recProcInfo.hProcess)
End If


My problem is that in the batch file, I lose all environnement variables (Path, SystemRoot), and I have no idea why, because in MSDN, it says that the new process should use the environnement variables from the creator of the process.

Anyone could help me on this point ?

Thank you !
Jerome
GeneralStoring and retrieving problem Pin
hibiki19798-Dec-02 14:39
hibiki19798-Dec-02 14:39 
GeneralRe: Storing and retrieving problem Pin
David Stone8-Dec-02 16:49
sitebuilderDavid Stone8-Dec-02 16:49 
GeneralRe: Storing and retrieving problem Pin
hibiki19798-Dec-02 19:00
hibiki19798-Dec-02 19:00 
GeneralRe: Storing and retrieving problem Pin
-- NA --10-Dec-02 7:06
-- NA --10-Dec-02 7:06 
GeneralDouble click on windows data grid Pin
Pandy8-Dec-02 2:27
Pandy8-Dec-02 2:27 
GeneralCustom TextBox Drawing Pin
mikasa6-Dec-02 5:40
mikasa6-Dec-02 5:40 
GeneralChecking status of DLL in Com Object Pin
BravoTwoZero5-Dec-02 22:41
BravoTwoZero5-Dec-02 22:41 
Questionhow to choose among VC/VB/C#? Pin
devvvy5-Dec-02 3:41
devvvy5-Dec-02 3:41 
AnswerRe: how to choose among VC/VB/C#? Pin
Michael P Butler5-Dec-02 4:20
Michael P Butler5-Dec-02 4:20 
GeneralRe: how to choose among VC/VB/C#? Pin
Christian Graus5-Dec-02 7:17
protectorChristian Graus5-Dec-02 7:17 
AnswerRe: how to choose among VC/VB/C#? Pin
Christian Graus5-Dec-02 7:15
protectorChristian Graus5-Dec-02 7:15 
GeneralRe: how to choose among VC/VB/C#? Pin
devvvy5-Dec-02 10:06
devvvy5-Dec-02 10:06 
GeneralRe: how to choose among VC/VB/C#? Pin
Christian Graus5-Dec-02 10:54
protectorChristian Graus5-Dec-02 10:54 
GeneralRe: how to choose among VC/VB/C#? Pin
devvvy5-Dec-02 11:16
devvvy5-Dec-02 11:16 
AnswerRe: how to choose among VC/VB/C#? Pin
Ray Cassick5-Dec-02 10:41
Ray Cassick5-Dec-02 10:41 
GeneralIndex number starting point HELL! Pin
Ray Cassick4-Dec-02 20:05
Ray Cassick4-Dec-02 20:05 
GeneralRe: Index number starting point HELL! Pin
Christian Graus4-Dec-02 20:20
protectorChristian Graus4-Dec-02 20:20 

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.