1

I found a lot of stuff online about creating invisible bat files. I came closest to wrapping my mind around this one:

Run a batch file in a completely hidden way

However, in my application, I can't figure out how to get this to work. Here is my current setup that works (with annoying cmd windows popping up all over the place).

I am using the app uTorrent to run a bat file whenever a torrent finishes. Within the app, there is a field to "Run this app when a torrent finishes". I have entered:

C:\scripts\torrentscript.bat "%D" "%N" "%L" "%K" "%F" >> C:\scripts\torrentlog.txt

Can someone hold my hand through setting this up so that the bat runs invisibly? I cant figure out how to pass all the parameters through properly. A huge bonus would be if I could keep the log file working properly as well for debugging.

Thank you so much!!

ETA bat file:

@echo off
title Duplicating a Freshly Downloaded Movie or Show
rem Parameter usage: fromdir torrent-name label kind [filename]
rem corresponds to uTorrents flags: %D %N %L %K %F 
echo *********************************************
echo Run on %date% at %time%

set fromdir=%1
set name=%2
set label=%3
set kind=%4
set filename=%5
set savepartition=J:
set moviedir=%savepartition%\"Movies [NOSYNC]"
set showdir=%savepartition%\"TV [NOSYNC]"

rem Only process PTP or BTN Auto torrents
if %label%=="PTP" goto movie
if %label%=="BTN Auto" goto show

GOTO :EOF

:movie
echo ***Movie**********
set todir=%moviedir%
set type="New Movie"
if %kind%=="single" goto single
goto multi

:show
echo ***Show**********
set todir=%showdir%
set type="New TV Show"
if %kind%=="single" goto single
goto multi

:single
echo Single
echo %fromdir%%filename% %todir% /I
xcopy %fromdir%%filename% %todir% /I
goto growler

:multi
echo Multi
echo %fromdir% %todir%\%name% /I
xcopy %fromdir% %todir%\%name% /I
goto growler

:growler
call "C:\Program Files (x86)\Growl for Windows\growlnotify.exe" /a:"uTorrent" /n:"Finished" /t:%type% %name%
echo Processing Complete on %date% at %time%

2 Answers2

1

There are two ways to interpret this question. I will address both the ways I can interpret it.


  1. If you just don't want any text printed to the black box, but still want the black box to appear, add @echo off to the top of your batch file.

  2. If you don't want the black box to appear at all (run in background), I have been very successful with Bat to Exe from f2ko.

It is not, as far as I know, possible to run a plain batch file without a black box, but by converting it to a windows executable with this program, you can check a checkbox labeled 'run in background'. This is how I have always done it. You can even add icons!

If you just used piping to create your log file ( >, |, <, etc), then this should allow you to log. Otherwise, it should do anything a normal batch script would, just without a black box.

Wyatt Ward
  • 1,209
0

You may also just run hidecon.exe from your batch. This won't however hide it from process list.