Process command and autorun variable

G

Greg

Hello,

I am trying to do some junit testing of a process command. I need to mock out what the regular process command says to the java code. My junit writes to a file and then makes a windows alias to concatenate the file when thecommand is executed instead of executing the regular system command. It sets this value in the autorun variable in the registry. When I pull up a command prompt, it works. However, my java process execution is somehow still reading the system command. How do I get it to use my stuff? Any ideasor suggestions? All are welcome. Thank you.

Greg
 
B

bob smith

Hello,



I am trying to do some junit testing of a process command. I need to mock out what the regular process command says to the java code. My junit writes to a file and then makes a windows alias to concatenate the file when the command is executed instead of executing the regular system command. Itsets this value in the autorun variable in the registry. When I pull up acommand prompt, it works. However, my java process execution is somehow still reading the system command. How do I get it to use my stuff? Any ideas or suggestions? All are welcome. Thank you.



Greg

Are you talking about the command-line utility "ps"?
 
L

Lew

Greg said:
Hello,
I am trying to do some junit [sic] testing of a process command. I need to mock out what the regular process command says to the java [sic] code. My junit writes to a file and then makes a windows [sic] alias to concatenate the file when the command is executed instead of executing the regular system command.

What is the "regular system command"?
It sets this value in the autorun variable in the registry. When I pull up a command prompt, it works.

What value? What works?
However, my java process execution is somehow still reading the system command.

What system command?

What does the Java code say?

http://sscce.org/
How do I get it to use my stuff? Any ideas or suggestions? All are welcome.


Show us your stuff. Right now it's like we're the mechanic and you're asking us,
"My car doesn't steer correctly. How do I get it to steer correctly?"

Give us data. Tell us what you're talking about.

Based on what you've said so far, I can diagnose your problem. Your Java code
is not using the Windows Registry (for which 'Preferences' might help), andis
directly invoking that mysterious, anonymous "regular process command". As a
result it's doing precisely what you're asking it to do.

So what are you asking it to do?
 
G

Greg

So here is my command: reg add "HKCU\Software\Microsoft\Command Processor\"/v AutoRun /t REG_SZ /d "doskey net=type %1$s"

That command should cat using type my file.

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top