简体   繁体   English

我的批处理文件,java和命令提示符中存在未知的修改错误

[英]there's unknown modification error in my batch file, java and command prompt

I have an "error" in my batch file and volatility (in command prompt). 我的批处理文件和易失性(在命令提示符下)出现“错误”。 I want to run it in a thumbdrive (still testing) but the error just looks super weird 我想在拇指驱动器中运行它(仍在测试中),但错误看起来非常奇怪

In my batch file (MyBatchFile.bat) 在我的批处理文件(MyBatchFile.bat)中

E:   
vol231.exe -f E:\USER-PC-20140707-141900.raw imageinfo > Volatility.txt
exit

In java coding (using elicpse) 在Java编码中(使用elicpse)

import java.io.*;
public class Run3
{
public static void main(String args[])
    {       
        try 
        {
            Runtime rt = Runtime.getRuntime();
            Process p = rt.exec("cmd /c start E:\\MyBatchFile.bat");
        } 
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }
}

Everything looks fine here. 这里一切都很好。 And it can run too. 它也可以运行。 But when the command prompt comes the volatility part. 但是当命令提示符出现波动部分时。 I don't know why. 我不知道为什么 The command would become like this (see below). 该命令将如下所示(参见下文)。

vol231.exe -f E:\USER-PC-20140707-141900.raw imageinfo 1> Volatility.txt

I don't know where the hell the "1" comes from. 我不知道“ 1”从哪里来。 and this affected my memory analysis. 这影响了我的记忆分析。 I wanted to try coding using java whereby everything just analysed on its own when I run the program. 我想尝试使用Java进行编码,因此在运行程序时,所有内容都可以自行分析。 Still trying. 仍在尝试。

But then... Can anyone help me with this error for now? 但是然后...有人能暂时帮助我解决此错误吗? This problem has squeezed out all my brain juice! 这个问题挤出了我的脑筋!

Any help would be greatly appreciated!!! 任何帮助将不胜感激!!! Thanks in advance. 提前致谢。

Cheers, 干杯,
Linify Linify

Output in as for example in a windows shell can to go stdout or stderr. 例如在Windows Shell中的输出可以转到stdout或stderr。 You redirect with > file. 您使用>文件重定向。 Doing so results in redirect stdout to the file. 这样做会导致将标准输出重定向到该文件。 If you want redirect stdout and stderr you adress them with a number. 如果要重定向stdout和stderr,请给它们添加一个数字。 1 for stdout 2 for stderr. stdout为1,stderr为2。 if omitting the number default is 1 stdout. 如果省略数字,则默认为1标准输出。

When excute for example 例如当执行

echo "Frodo" > test.txt

the text frodo is written to test.txt. 文本frodo被写入test.txt。 But also the command shell echos what you did. 但是命令外壳也会回显您所做的事情。 it echoes: 它呼应:

echo "Frodo" 1> test.txt

the 1 is to remind that the output of stdout is captured and not stderr. 1是要提醒stdout的输出是捕获的,而不是stderr。

With your script is nothing wrong. 使用您的脚本没什么错。

When I remember right you can turn the command echoing of in the batch with 当我没记错的时候,您可以使用

@echo off.

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM