Hi Guys, im trying to get VB to run the regedit.exe function with the following command line
regedit.exe /E C:\VB.txt "HKEY_LOCAL_MACHINE\Software\Aberlink 3D"
Anybody have any ideas? The problem i have is getting VB 2005 to export an entire subkey rather than just one value at a time. Am i going down the right route with using regedit or is there a function within .net that will do this for me?
Thanks in advance
Ben
14 3412
Check the Process class.
It will take a filename and arguments
There is also a Registry class for editing the Registry settings though
Cheers Plater, but ive been using the process class and it doesn't like and parameters after the .exe ive also played with the registry class but there isnt a function to export a part of the registry :(
Cheers Plater, but ive been using the process class and it doesn't like and parameters after the .exe ive also played with the registry class but there isnt a function to export a part of the registry :(
What does your code look like for the arguments and the like?
Here is the line ive been playing with: - Private Sub ExportReg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportReg.Click
-
Process.Start("regedit.exe /E C:\Regtest.reg "HKEY_LOCAL_MACHINE\Software\Aberlink 3D")
-
End Sub
But it refuses to let me run the .exe with added parameters, i delved into the My.computer.registry functions again with no luck.
Thanks again
Here is the line ive been playing with: - Private Sub ExportReg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportReg.Click
-
Process.Start("regedit.exe /E C:\Regtest.reg "HKEY_LOCAL_MACHINE\Software\Aberlink 3D")
-
End Sub
But it refuses to let me run the .exe with added parameters, i delved into the My.computer.registry functions again with no luck.
Thanks again
Process.Start has an overload where you can pass parameters. Its something like: - Process.Start(string Filename, string Arguements);
Process.Start has an overload where you can pass parameters. Its something like: - Process.Start(string Filename, string Arguements);
Thanks that seems to have done the trick, below is the function of clicking a button, the command works fine until the Reg key i want to export has a space somewhere in the key name.
IE Aberlink 3D shown below: - Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
-
Process.Start("C:\Windows\Regedit.exe", "/e C:\Joy.xxx HKEY_LOCAL_MACHINE\SOFTWARE\Aberlink 3D")
-
-
End Sub
Anybody know how to get around this??? been trying for the last day. The command works fine if i were to use the "Ahead" key rather than "Aberlink 3D" for example
You are going to need to put the argument itself in quotes (as opposed to just a string in code) -
-
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
-
Process.Start("C:\Windows\Regedit.exe", "/e \C:\Joy.xxx \"HKEY_LOCAL_MACHINE\SOFTWARE\Aberlink 3D\"")
-
-
End Sub
-
The \" is used to insert a " inside a string, so just make sure they wrap around the correct parts
still wont run with that space between "Aberlink 3D". im so close if it werent for this silly void between words!
Try "[" or "(" or something then?
Or look up the help for that command on msdn?
still no joy, VB obviously sees the space and assumes that the "3D" is a seperate parameter. I cant see any way of getting round it unless VB has its own export function. All the functions i have found only include low level functions like, read, write, create and delete. i will venture on though!
The argument you are using, is it a file? If it is a file you will need the full file extension...
also have you tried typing exactly what you have in the string into the command prompt...?
I managed to get this working, with the space, but it is using a txt file not a directory, hope this helps. -
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Process.Start("notepad.exe", "C:\Documents and Settings\User\Desktop\test test.txt")
-
End Sub
-
Also it appears you are using more than one argument, maybe you have to put them as seperate strings, although i doubt it, i'm just thinking outloud...
any additional info u have on the prob will help with the solution!
Martin
Hi Martin, the code i have works providing there isnt a space anywhere in the registry path i want to export. Which is a real pisser considering the part of the registry i need is some software called "Aberlink 3D". I just need to code it so it sees "Aberlink" and "3D" as the complete path name rather than two seperate entities.
Hi Martin, the code i have works providing there isnt a space anywhere in the registry path i want to export. Which is a real pisser considering the part of the registry i need is some software called "Aberlink 3D". I just need to code it so it sees "Aberlink" and "3D" as the complete path name rather than two seperate entities.
So it is a directory then.... try -
Process.Start("C:\Windows\Regedit.exe", "/e C:\Joy.xxx \HKEY_LOCAL_MACHINE\SOFTWARE\Aberlink 3D\")
-
To be honest i have never used the function that you are using, but I have used command line args, and when passing a directory I found that you had to pass the full name with the final "\".
Report back, this is annoying me, tho i can appreciate not as much as it annoys you!
Martin
Martin you are a saint my friend! i have managed to get it to export finally! - Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Process.Start("c:\Windows\regedit.exe", "/e c:\AB3DSettings.reg ""HKEY_LOCAL_MACHINE\Software\Aberlink 3D\""")
-
-
End Sub
-
I had to double quote the arguement but the \ has done the trick. My hero :)
Thanks again to Plater for you help, most appreciated :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Christopher Brandsdal |
last post by:
Hi!
I have a problem running my code on 2000 server and iis5.0.
The code runs perfectly on my localhost (xp iis5.1) but when i run it on
2000 server iis5.0 I get this error:
...
|
by: Ross Presser |
last post by:
OK, I've been researching this problem and can't find a definitive answer
yet.
The situation is one that seems to have come up a few times to different
folks. I am writing an application that...
|
by: bbxrider |
last post by:
for win2k adv server/iis5.0
trying to run an external program from my asp routine that has multiple
parameters, see following
set shell = server.createobject("wscript.shell")
shell.Run...
|
by: jsw_nz |
last post by:
Helo, my first post here....
I am trying to run an agent application that converts and imports two
tables from MS Access into mySql.
(Intelligent Converters - Access2mySql)
I have run similar...
|
by: Peter Rilling |
last post by:
I have an EXE that I would like to be able to run from either the
command-line or as a windows service.
Is there a way that I can tell which context the program is running in?
Basically, if it...
|
by: M K |
last post by:
Heres my SP: ( i am trying to add more than 1 field but get the same error
no matter how many i try to add, i thought i would try to insert the primary
key only and work up from there but the...
|
by: Brad Pears |
last post by:
I want to pass an integer customer# into my vb app from the command line
when I run it... something like this....
c:\program files\Myapp\myvbapp.exe 100
So in the case above, when my...
|
by: Claire |
last post by:
Hi,
I'm trying to run mysqldump.exe from my c# application, running on windows
vista with visual studio 2005.
The following code does not produce the output file. The same line used in a
command...
|
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= |
last post by:
On reflection, you could possibly make the app a self extracting zip file
which extracts the EXE and a settings file and then starts the app, then when
you app closes, it can repack the settings...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |