1.

Solve : DOS program to open file and writing to a file and closing the file?

Answer»

hi,
Can any body help me in this?

One batch file(main), when it is executed,it should create one file, and write some data in to file,close the file when exiting.

Thanks,
Rajais this your homework?i didn't get you, but i want to know how to do this.Quote from: grsvarma019 on July 18, 2008, 12:48:00 AM

i didn't get you, but i want to know how to do this.

I asked, is this an assignment from school?
No yar, i am doing some project,, in that i need it.
You do not describe the problem fully enough.

If you want to echo data to a file you can do this to start the file

echo something > filename

then if you want to add data you can do this

echo something else >> filename

I have one main file named "file1.bat".

This contains the following stmt.

wscript.exe "invis.vbs" "rat.bat"

The file invis.vbs contains the following stmt:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

The rat.bat file contains the following stmt:

set path=Java\jdk1.6.0_06\bin;Java\jre1.6.0_06\bin;
java -JAR RemoteAccessTool.jar


The main aim of these three files is to hide the dos window when bat file is executed.

The main batch file is "rat.bat".

You can tell me the answer in two ways.

1>> how to hide the dos window when a batch file executed.

2>> file1.bat in this topic has to do the following:

It should create the file invis.vbs file and put the mentioned stmt in that file.
It should create the file rat.bat file and put the mentioned stmt in that file.

Then, it should EXECUTE the following stmt:

wscript.exe "invis.vbs" "rat.bat"

NOTE: My objective is to club the three files into one file.


Thanks,
Rajaare you trying to write a virus or hidden snooping program?no yar..

Please have a look at the statements.

It just SETS the path to java and invokes certain application.(RemoteAccessTool.jar).

Here: Dos window must be hidden, and application GETS executed.

Its not a virus and some other kind.


Discussion

No Comment Found