Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

run bat or cmd in the backround


  • Please log in to reply
4 replies to this topic

#1 namo

namo

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:06:22 AM

Posted 12 January 2009 - 01:02 PM

Is there a line that you can add to bat or cmd file so that command prompt won't open when the file run?

for example for autolock XP , I have a .cmd file that run on the startup with lines :

--------------------------------------------------------

@ECHO OFF

%windir%\system32\rundll32.exe user32.dll,LockWorkStation

-----------------------------------------------------------

but command prompt window opens when you run the files then close

Edited by namo, 12 January 2009 - 01:20 PM.


BC AdBot (Login to Remove)

 


#2 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:04:22 AM

Posted 12 January 2009 - 03:35 PM

None that I'm aware of, but the exit command placed at the end will close the command box once it's done executing the script.

Also, if all you're trying to do is lock the workstation quickly, then you don't need a batch file; you can simply press the Windows Logo Key + L to lock the computer.

#3 lowtek_otc

lowtek_otc

  • Members
  • 280 posts
  • OFFLINE
  •  
  • Local time:06:22 AM

Posted 12 January 2009 - 05:34 PM

To my knowledge, all bat commands run in a command prompt. There is probably a way to minimize it though. The exit command will close the cmd window.

#4 namo

namo
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:06:22 AM

Posted 12 January 2009 - 07:51 PM

Amazing Andrew, I need the file for automatic lock after the start up

lowtek_otc , I found a method which I don't remember whar to start the command window minimized but it was for Win 9X

#5 namo

namo
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:06:22 AM

Posted 13 January 2009 - 05:45 AM

None that I'm aware of, but the exit command placed at the end will close the command box once it's done executing the script.

Also, if all you're trying to do is lock the workstation quickly, then you don't need a batch file; you can simply press the Windows Logo Key + L to lock the computer.



To my knowledge, all bat commands run in a command prompt. There is probably a way to minimize it though. The exit command will close the cmd window.

I found a method at least start bat or cmd file minimized. Instead of putting the file at the startup folder, I put the file somewhere else, and I put a shortcut to it in startup folder. and in the shortcut properties I chose to start the file minimized I found this picture for something elese and gave me the idea

Posted Image

Edited by namo, 13 January 2009 - 05:46 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users