MSFN Forum: How2 run BAT files in background - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How2 run BAT files in background no window Rate Topic: -----

#1 User is offline   Fredledingue 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,196
  • Joined: 10-February 05
  • OS:98SE
  • Country: Country Flag

Posted 22 May 2005 - 04:25 PM

I wrote some batch files, but I want them to run in the background (without dos-prompt window, even not minimized). The user doesn't need to inerfere with the script because it always does the same things. But its useless windows poping up in the taskbar are annoying and cause slow computers to scratch.

thanks.


#2 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 7,756
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 22 May 2005 - 04:44 PM

Ummm just send it to me and I will compile into an exe for you.

I can make it run silently in the background with no sign it is running.

#3 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,112
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 23 May 2005 - 10:38 AM

Well, there is this little tool too:
http://www.commandline.co.uk/cmdow/

or this vbs solution:
http://www.jsifaq.co...9200/rh9242.htm


or this spawner:
http://www.joeware.n...tools/quiet.htm

jaclaz

#4 User is offline   Fredledingue 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,196
  • Joined: 10-February 05
  • OS:98SE
  • Country: Country Flag

Posted 23 May 2005 - 04:20 PM

This is the batch file I want to run in the bkgrd.

The batch file should be launched by a right-clic menu (that I add myself with ContextEdit) on selected files in Explorer.
The goal is to launch only one instance of a script or program for the whole selection instead of one instance for each selected file.
All the paths are writen in a list, then the script read this list and perform accordingly.

The trick used is deleting a nul file, an operation that obviousely only one instance of the batch file can do (a file can be deleted only once). Then if the file already doesn't exist, it skips the script launch command...and only apend the path to the list.
Later, the script re-create the nul file and erase the list.

I did a similar script in VBS but it was disastrous on a slow computer. In BAT it works better albeit with some errors (some selected files are not added to the list).
And there are also these invasive taskbar tabs... that certainely waist the rarefied resources of the old computer.

x.nul is the nul file
tmp.txt is the list file
ess2.vbs is the script to be launched.

@echo off
if not exist C:\Progra~1\Bat&vbs\x.nul goto writelist
del C:\Progra~1\Bat&vbs\x.nul
cd..
cd \WINDOWS
C:\WINDOWS\WScript.exe "C:\Progra~1\Bat&vbs\ess2.vbs"
:writelist
echo %1 >> C:\Progra~1\Bat&vbs\tmp.txt
exit


#5 User is offline   Fredledingue 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,196
  • Joined: 10-February 05
  • OS:98SE
  • Country: Country Flag

Posted 23 May 2005 - 04:29 PM

and it must run on W98 so NT/2000/XP-only solution won't help...

#6 User is offline   Fredledingue 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,196
  • Joined: 10-February 05
  • OS:98SE
  • Country: Country Flag

Posted 24 May 2005 - 02:16 PM

kelsenellenelvian, on May 22 2005, 04:44 PM, said:

Ummm just send it to me and I will compile into an exe for you.

I can make it run silently in the background with no sign it is running.
<{POST_SNAPBACK}>


Thanks, I'v got the exe. I'll try tomorow, I'm too tired tonight...

#7 User is offline   Fredledingue 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,196
  • Joined: 10-February 05
  • OS:98SE
  • Country: Country Flag

Posted 05 June 2005 - 01:22 PM

kelsenellenelvian,

Thanks for the exe! It works! Thought I coudn't try it on the slow computer.

But I will need to know how you did because I will need to do a version for each vbs.

Also why 150 kb! Did you add your personal flash screen or something? :D

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy