Page 1 of 1

CMD Vista

PostPosted: Wed Jul 08, 2009 2:08 pm
by .Yunoko
Hi I was just wondering, is it possible to make a .bat file where after say 15 seconds of it being open, it exits (closes)? Thanks.

PostPosted: Wed Jul 08, 2009 4:52 pm
by AdventWolf
There is some info here http://www.computerhope.com/batch.htm#4

website wrote:Creating a batch file delay

Below is an example of how to delay a batch file any where from 5 to 99 seconds. In the below example we illustrate a 5 second delay.

TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL


Is that it?

PostPosted: Wed Jul 08, 2009 5:02 pm
by .Yunoko
Urm. I don't think so, I tried it but nothing happened. What I am looking for is, after say I open my .bat file and after 15 seconds or w.e of it being open and nothing happens to it, it closes. That I believe logs off your computer or puts it to sleep.

PostPosted: Wed Jul 08, 2009 5:08 pm
by AdventWolf
Oh, I'm not sure. You'll probably need to look into a lot of .Bat functions to find and put together what you want.

PostPosted: Wed Jul 08, 2009 5:20 pm
by .Yunoko
Okay so this is what I have so far. I have a .bat file. With this.

cls
@ECHO OFF
title SYSTEMRECOVERY.DPX
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Start System Recovery (Yes/No)
set/p "cho=>"
if %cho%==Yes goto LOCK
if %cho%==Yes goto LOCK
if %cho%==No goto END
if %cho%==No goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo A problem has been detected starting System Recovery.
echo Windows has shut down the operation to prevent damage to your computer.
echo The problem seems to be caused by the following file: SYSTEMRECOVERY.DPX
echo PAGE_FAULT_IN_NONPAGED_AREA
echo If this is your first time youve seen this stop error screen,
echo Restart your computer. If this screen appears again, follow
echo These steps:
echo Check to make sure any new hardware or software is properly installed
echo If this is a new installation, ask your hardware or software manufacturer
echo For any Windows updates you might need.
echo If problems continue, disable or remove any newly installed hardware or
echo Software, disable BIOS memory options such as caching or shadowing.
echo If you need to use Safe Mode to remove or disable components, restart
echo Your computer, press F12 to select Advanced Start up Options, and then
echo Select Safe Mode.
echo Technical Information
echo *** STOP: 0x00000050 (0xfd3094c2, 0x0000001, 0x000000)
echo *** SYSTEMRECOVERY.DPX – Address FBFE7617 base at FBFE5000, DataStamp 3d6dd67c
set/p "pass=>"
if NOT %pass%== MYPASSWORD goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End


(Its a Fake out hidden folder to store my crap aha)
What that does is it creates a hidden folder. So I click on the .bat file it opens up the CMD and I type in my password to access my hidden folder. Once I am done I click on it again, and I type Yes and it closes. But what I want is if I don't, or if somebody else. Doesn't type in the password within 5 seconds it closes. So I found out the CMD to do that. its.....

TIMEOUT 5
EXIT


I tried that out in.....



IPCONFIG
TIMEOUT 5
EXIT


and it worked. But I am trying to install that text somewhere in my hidden folder script, but its not working. I had it here....

echo *** SYSTEMRECOVERY.DPX – Address FBFE7617 base at FBFE5000, DataStamp 3d6dd67c
TIMEOUT 5
EXIT
set/p "pass=>"
if NOT %pass%== MYPASSWORD goto FAIL


and it works but and all....

Image

but as you can see, after it says waiting for 2 seconds. It says "press any key to continue" well its kind of hard to type in my password when that shows up and I click anything and it closes. So now I need to get rid of the "press any key" but keep the rest. Lol. Thanks![/list]

PostPosted: Wed Jul 08, 2009 8:24 pm
by ace
Bah I'm running w7rc and I copied the same batch file and whenever I run it all it does is make a "Private" folder on my desktop. But my guess would be to add TIMEOUT 5 EXIT either directly after the if NOT %pass%== MYPASSWORD goto FAIL line or one line before :End.

PostPosted: Wed Jul 08, 2009 8:35 pm
by .Yunoko
Nope not working. I did try putting it just before my first ECHO under :UNLOCK but I am still having the problem after the timer stops or even during it. If I click anything it just exits.

PostPosted: Sat Jul 11, 2009 9:00 pm
by Kanadier
If you wanna secure your porn, there's more practical ways Yunoko... lol

PostPosted: Sun Jul 12, 2009 2:02 am
by Alex Finlay
Diehard335 wrote:If you wanna secure your porn, there's more practical ways Yunoko... lol


Rofl :-) mines secure lol. *portable hardrive baby*

PostPosted: Sun Jul 12, 2009 12:39 pm
by .Yunoko
Thanks. Lol never said it was porn though xD it might just be other types of files I need secure ;) Plus I have an external hard drive but still somebody grabs that they can still get to that! Doesn't matter though, I will just keep the .bat command the way it is. It works good :)