473,290 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,290 software developers and data experts.

cmd error=2

hsn
237 100+
hello everyone.
i am using the process class with the runtime for sure. as you know i use it for running commands on my windows cmd.
the usual commands work just fine such as, ping yahoo.com, ipconfig, and so much more.
with my windows vista the stupid and annoying UAC (user access control is not letting my program to use the cmd as admin. so i have downloaded a program called start ++, this program is very useful, by using this command i can run the cmd normally, type in "sudo cmd.exe", and then an admin cmd pops up and i can run all my lovely commands.

NOW IS THE PROBLEM and the reason for reading this post:

when i use the process clas and enter the command "sudo cmd.exe /k ipconfig /flushdns" java says:

Cannot run program "sudo": CreateProcess error=2, The system cannot find the file specified

can someone help me to be able to make java run my command

thanks for reading and see you at other posts

regards
hsn
Nov 14 '08 #1
6 2687
hsn
237 100+
sorry i forgot to say something

i have windows VISTA when i use the start button i write in the search text field
sudo cmd .exe
and then the admin cmd runs
Nov 14 '08 #2
Nepomuk
3,112 Expert 2GB
Wow, interesting tool, that Start++. I assume, that the problem is the following:
Java tries to execute the sudo command with cmd, however it is only known to the Start++ version of cmd. So, it should work with something like
C:\path\to\start++ sudo admin ...
So, you'll have to find out, where Start++ has it's version of cmd.

The best place to find this out is probably the Start++ Forum on brandontools.com (where the Tool originates from).

Greetings,
Nepomuk
Nov 14 '08 #3
hsn
237 100+
thanks for your reply
when i run cmd normally i enter "sudo cmd.exe" i understand your reply 100%, and i am looking through what you have told me. but isn't the process class with runtime runs a cmd process? and if so shouldn't it accept the command "sudo cmd.exe" just like the cmd which is being run by double clicking on its icon???
Nov 14 '08 #4
hsn
237 100+
also, sudo is a command in linux. what the creator of start++ did, is adding a service to windows. sudo is a super user command used in linux.
i went to the path of start++ there is no sudo command or program over there.
Nov 14 '08 #5
Nepomuk
3,112 Expert 2GB
when i run cmd normally i enter "sudo cmd.exe" [...] but isn't the process class with runtime runs a cmd process? and if so shouldn't it accept the command "sudo cmd.exe" just like the cmd which is being run by double clicking on its icon???
Well, I don't know how exactly Start++ works, but I'm guessing, it either provides an own version of cmd (which wouldn't necessarily be called by Java) or it adds tools, which the normal cmd can use (in which case, the command "sudo cmd.exe" should work from Java, I think). As I said, the Start++ Forum is probably the best place to find that out.
also, sudo is a command in linux
Indeed, it is. Knowing that, you can understand this comic:

:-D
i went to the path of start++ there is no sudo command or program over there.
Hm, have you searched your computer with the Windows search function? There may not be such a program, but you never know.

Greetings,
Nepomuk <--- Linux user
Nov 15 '08 #6
hsn
237 100+
well i searched in the prgram files.
when i write in the start search the "sudo" command this comes up

(Link)

it is strange how that icon comes up. when ever i put any search key in the start search a small icon come up, but with this it is a huge icon
strange
Nov 15 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
1
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly,...
0
by: mchuc7719 | last post by:
Hello, I have a Vb.Net 2005 ClassLibrary, when I try to compile using MSBee, only get errors. Before I to run the command line, I open in notepad the .vbproj and I was add the next line: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.