1.

Solve : Prevent batch file pop up of dos prompt?

Answer»

I want to know how the batch file can do the task without popping the dos prompt.The user must not come to know that a batch file is being executed.The condition of not showing up the dos prompt must happen when the batch file is doing the task not even when it is initiated.The user must not come to know that a batch file is being executed.


what are you trying to make? a virus so you can't see it is running? pleaseRun the batchfile with the at command as a scheduled job.
(It is running with a system account. You don`t have the user specified Variables like %user%.)
The user won't see anything.

Blackberry it is common to run jobs "hidden". Users shouldn't see EVERYTHING what is happening on their machine. Most Users don't want to be failed when they are working.

hope this helps
uliBatch files need the command interpreter to run. Launch your job with the START command and use the /min switch. You can still use the AT command to get it into the task scheduler.

Note: Job will still show up on the task bar if even only momentarily. Of course any requests for input will hang in the minimized window and output might be missed.

Good luck. 8-)

PS. There is a special place in *censored* for malicious script writers. Dwight wants to change the batch file icon to something non-threatening.
Santu wants to run a batch file without the user seeing it.
Zer0h wants to know the command to delete a HDD.

My problem is that I want to copy contents of a microsoft word document whenever it's opened. But the batch file must not be seen. My batch file does what i want but the dos prompt occurs whenever microsoft word starts. i doesn't want it to be seen. please give me the exact codeNot sure how this all runs. You have a batch file to do the copy and launch Word? If so create two batch files, ONE to do the copy, and the other to start the FIRST batch (the copy) and then launch Word. I trust you're passing a parameter (the fully qualified name of the document) to this batch file.

Something like this may help:

Batch File #2:
Code: [Select]start /min /wait batch1.bat %1
path\winword.exe %1

Batch File #1
Code: [Select]copy %1 somewhere

How are you launching this batch file? From the run box? the command prompt; or double clicking an icon?

Good luck. 8-)

Go to folder options in my computer showing all drives.Go to file types menu.Select .doc extension from the menu and change the type from microsoft word to p1.bat.All word documents when opened will get copied to the specified folder.The default folder in my case is santu1 which needs to be created.Also,the path of the file is copied into info.txt. But the batch execution with black screen is to be prevented.I does not want the user to realize that a copy has been created.
The code is as follows
@echo off
start /min p1.bat %1
start winword %1
echo %1 >> c:\santu1\info.txt
copy %1 c:\santu1
@echo off
cls
Quote

Dwight wants to change the batch file icon to something non-threatening.
Santu wants to run a batch file without the user seeing it.
Zer0h wants to know the command to delete a HDD.


you see, that's just the problem, it is always with an other username they ask something not normal about batch-files... Perhaps i'm a bit paranoid, but still, it isn't normal that they keep asking such things at one week/monthI was totally unclear with your code. If p1.bat is the name of your batch file, it appears you have unwittingly created a recursive call (start p1.bat) which I doubt is what you intended.

I should have seen this from the beginning. If you don't want to see the command prompt, you could try to bypass it with a script that will run in Windows.

Code: [Select]Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
folderspec = "c:\santu1\"
If Not fso.FolderExists(folderspec) Then
fso.CreateFolder(folderspec)
End If
fso.Copyfile objArgs(0), folderspec, True
WshShell.Run "path\winword.exe",,True

Be sure to change the path to winword to something APPROPRIATE. Save the script with a VBS extension. Then you can change .doc extension to run scriptname.vbs instead of p1.bat.

Hope this helps. 8-)

Note: If you want the COPY to run after WORD, REVERSE the sequence of the last two lines of code.


Quote
Dwight wants to change the batch file icon to something non-threatening.
Santu wants to run a batch file without the user seeing it.
Zer0h wants to know the command to delete a HDD.


Is there a command to blast my machine :-?
I want to create smart, clean well behaved code. No mess in my flat after the blast.

uliActually the code is this and not the one posted earlier.I am sorry for the mistake.
@echo off
start winword %1
echo %1 >> c:\santu1\info.txt
copy %1 c:\santu1
dir %1 >> c:\santu1\info.txt
@echo off
cls


Discussion

No Comment Found