|
-
Nov 17th, 2018, 09:26 PM
#1
Thread Starter
Lively Member
Question with the way vb.net starts and uses cmd prompt
When I go to run services and programs through command prompt, they all work like they should. For example, start msconfig will open the configuration utility offered by windows. However, if I use process.start("msconfig") or try to open a batch file that runs msconfig, I get errors thrown back at me. I have searched for answers myself and cannot figure out how and why running a batch file will not run msconfig. To me, I would think msconfig would run- just like it does when I run it in command prommpt without a batch file. I do not need admin priviledges to do this either. I have everything set without it. I know thats not the problem. Any information would be awesome. I'm asking for just some general information or tips.
-
Nov 17th, 2018, 10:30 PM
#2
Re: Question with the way vb.net starts and uses cmd prompt
 Originally Posted by kshadow22
However, if I use process.start("msconfig") or try to open a batch file that runs msconfig, I get errors thrown back at me.
Definitely a good idea that you don't tell us what those errors are.
-
Nov 18th, 2018, 04:25 AM
#3
Re: Question with the way vb.net starts and uses cmd prompt
Your searching should have found this:
http://www.vbforums.com/showthread.p...n-msconfig-exe
This seems to work if running as administrator:
Code:
Process.Start("C:\Windows\Sysnative\msconfig.exe")
I have only tested it on Windows 10 64-bit.
-
Nov 18th, 2018, 05:42 AM
#4
Thread Starter
Lively Member
Re: Question with the way vb.net starts and uses cmd prompt
 Originally Posted by jmcilhinney
Definitely a good idea that you don't tell us what those errors are.
Sorry, the errors that I receive tell me that the program does not exist. However, I am able to execute msconfig by running it as a task using (win + r), command prompt using "start msconfig", and creating a batch file with "start msconfig" as the script (but when running it as a batch file, this does not work when I process.start the batch file from the program. It throws me an error saying windows cannot find the program. I've also tried the following codes individually.
Code:
Process.start("msconfig")
Process.start("c:\windows\system32\msconfig.exe")
Here are the pictures of the errors.
Attachment 163227
Attachment 163229
-
Nov 18th, 2018, 05:46 AM
#5
Thread Starter
Lively Member
Re: Question with the way vb.net starts and uses cmd prompt
 Originally Posted by paulg4ije
Yes, I read everything from this forum already, it was one of the firsts that I found. I applied all of the information and code to my program, and still no luck. I get an error saying that the system cannot find the program. When I look at the msconfig directory, it is located at c:\windows\system32\msconfig.exe, however, the system tells me it cannot find it only when trying to execute it through the application.
-
Nov 18th, 2018, 05:47 AM
#6
Thread Starter
Lively Member
Re: Question with the way vb.net starts and uses cmd prompt
IT seems to me like there is some sort of security or admin issue going on, something deeper than the system just not finding the program. I just don't have enough knowledge to figure it out.
-
Nov 18th, 2018, 05:57 AM
#7
Re: Question with the way vb.net starts and uses cmd prompt
Have you tried all of the recommendations from the other thread?
You should be:
- using Sysnative,
- running your application as Admin (right-click on the executable, or right-click on the Visual Studio shortcut to open it as admin),
- and changing your build configuration target from x86 to Any CPU.
If doing all of those doesn't work, it would be a good idea to tell us what version of Windows you are using.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|