Jump to content

Need batch file commands

- - - - -

  • Please log in to reply
16 replies to this topic

#1
ntieu22

ntieu22

    Newbie

  • Members
  • Pip
  • 7 posts
Hi there does anyone have a batch file command they can help me with.


I would like to have a batch file that cant take a file and convert it to a text file.

Is it possible to have a command where it takes a binary file or octect steamline file and convert everything that is in there into a text.

can someone have the commands that would be great..

thanks

#2
brownhead

brownhead

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
ren [filename goes here] *.txt


#3
ntieu22

ntieu22

    Newbie

  • Members
  • Pip
  • 7 posts
Is this correcet

ren [C:\Program Files\StorageCraft\ShadowProtect\Logs\{67E988AE-ED48-4E87-9405-FD14F7CB821F}] *.txt

Is there any other ccmmand I need to do when I create it and save it as a .BAT it doesnt do anything.

I am new at this

Edited by dargueta, 27 January 2011 - 01:28 PM.
Please don't type in uppercase like that; it's like yelling.


#4
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
I'm not sure if it's possible, a binary file is binary. It only contains 0s and 1s, you can only convert it to assembly with a disassembler.

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#5
ntieu22

ntieu22

    Newbie

  • Members
  • Pip
  • 7 posts
Or maybe its an otect steamline file. Can some give me the full command to take a file and convert it to a text

#6
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
If a file is a text file you'll already be able to read it as such. You can't convert "binary" to "text" since the computer makes no distinction - it's all stored as bytes on the disk. What are you asking here?

(By the way, this is in the wrong forum so I'm moving it.)
sudo rm -rf /

#7
ntieu22

ntieu22

    Newbie

  • Members
  • Pip
  • 7 posts
Thanks,


but I need a full command batch line to do this forget about the binary, I just need the commands to take a file to converet to text

#8
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Convert what to text? It's highly dependent on what kind of file you're trying to convert.
sudo rm -rf /

#9
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
He wants to convert binary to text; My guess is he's using Windows, so probably EXE or even COM.

@ntieu22, that's what we're trying to explain. You can't just forget about binary, because it can't be converted to simple text. Please be more specific. What kind of text are you looking for? Maybe you mean the output of the program, or the program's code in a given programming language? Even if you're not talking about binary I can't guarantee it's possible because batch command aren't magic, they can't do anything.

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#10
ntieu22

ntieu22

    Newbie

  • Members
  • Pip
  • 7 posts
I understand.


I want to change a text file to another text file. so what would be the full batch command be to do that. make a batch that would take the file and change it to another text to a diffrente location

#11
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
So...basically all you want to do is move files?
sudo rm -rf /

#12
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
That's simple.

move <file1> <file2>

The above command will take file1, delete it, and place it somewhere else, as file2. If you don't provide a full patch, the program assumes that the file is in the place where the program is executed, usually where the program's executable is. Here are some examples -

move foo.txt c:\stuff\programming\foo.txt

move foo.txt hello.g

move foo.txt c:\

The first command moves foo.txt from the program's directory to c:\stuff\programming, as foo.txt. You can write any filename and format you want.
The second moves foo.txt to the same directory, as hello.g. Basically, it renames the file. The last command moves foo.txt to c:\, under the same name. If you want to move multiple files, take a look at the following -

move foo1.txt,foo2.txt c:\

move *.txt c:\

move foo.* c:\

move *.* c:\

The first command moves foo1 and foo2 to c:\ under the same names. The second, moves every file with a txt format to c:\. The third moves every file named foo, no matter what format it has. The last one moves all the files in a directory.

If you don't want to delete the file, just use copy instead of move -

copy foo1.txt,foo2.txt c:\

copy *.txt c:\

copy foo.* c:\

copy *.* c:\


Posted Image
There is no problem that cannot be solved by the use of high explosives.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users