|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all .I have difficulty outputing the value of shell function into massagebox by using regoutput variable. Currently the shell function writes the output to .reg file but i want i want to output it to massage box but it never works!! The output value is list of registery information which are half a page char mostly .
i tried diffrent datatyes and i got diffrent 4 digit integer each time!! Below is the code and it writes the correct registery values into .reg file but i want to display it in massagebox and non of the data types works!! Is there any way to display the registeiory information directly into massage box instead of writing it to reg file.? since i evantually want to get rid of wirting to file process . I be happy if some expert help me.Thanks Code:
Private Sub Reg(Path As String)
Dim regoutput
task_id = shell("Regedit.exe /e " & Chr(34) & Path & Chr(34) & " " & Chr(34) & _
"HKEY_CURRENT_USER" & "\" & "Software\me\" & Chr(34))
'The Char For " is Chr(34)
MsgBox "shell function output: "+regoutput
End Sub
Private Sub Save_Click()
On Error Resume Next
CD.DialogTitle = "Save Registry Backup File As..."
CD.InitDir = App.Path
CD.Flags = &H4
CD.Filter = "Registry File Format (*.reg)|*.reg"
CD.ShowSave
If InStr(CD.FileName, ".reg") Then
Call Reg(CD.FileName)
DoEvents
Text1.Text = CD.FileName
End If
End Sub
Last edited by ehsanking : April 10th, 2006 at 01:18 AM. |
|
#2
|
||||
|
||||
|
what's wrong with just reading the reg file? the shell function output won't
be the list of registry values anyway so there's no point reading it. |
|
#3
|
|||
|
|||
|
Quote:
well the application writes the registery informtion to .reg file but i want to display it in massage box instead! |
|
#4
|
||||
|
||||
|
no, the application does not write to any file as far as I can see, unless there
is more code you didn't show. the application only execute the regedit program. if there is other code that really writes to file, please post it here. |
|
#5
|
|||
|
|||
|
You can pipe the output to a text file and then use the contents of the text file in your code, but you'll have to change from Shell to an API call that runs synchronously with your VB code.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#6
|
|||
|
|||
|
Quote:
Many thanks for u reply. I borrowed this code and i do not know muach about API . could u show me how i can use API instead and read the output from text file and display it in massage box.Thanks |
|
#7
|
|||
|
|||
|
There is a site that is dedicated to windows api functions, I think it's allapi.net or something like that, and I think you'd need the waitforsingleobject() api function to get your vb code to wait for the results of your external program.
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > How to put result of shell function into variable? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|