Computing.Net > Forums > Programming > batch can open automaticly

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch can open automaticly

Reply to Message Icon

Name: raygate
Date: November 21, 2008 at 05:45:50 Pacific
OS: xp
CPU/Ram: xp
Product: xp
Comment:

hi every one...

I'm asking there is secrip for the pach to oper it or run it automaticly after tirng on the computer ...

e.g: the bath run or opend after 5 minet from tuning on the compuer >>> withuot the cliking ... only by setting a time ..



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: November 21, 2008 at 06:21:16 Pacific
Reply:

raygate,

If you keep this script in startup folder,
it will launch itself, wait for 5 minutes,
and then do "your-operations"
Also, 5 minute is approximate. Not exact.

However, the 5 minutes is not from the time the machine was switched on.
It is 5 minutes from the time the user was logged in to XP and the commands in startup folder is invoked.


ping -n 300 127.0.0.1 > nul
:: Put "your operations" below here.

--
Holla.


0

Response Number 2
Name: pball
Date: November 21, 2008 at 06:22:20 Pacific
Reply:

Hmm if I understood your question I think I can help.

If you are looking to have a batch run 5 minutes after the computer is turned on that is simple.

Put this as the beginning of the batch file

echo Wscript.Sleep 3000000> sleep.vbs
start /w wscript.exe sleep.vbs
del sleep.vbs

That waits 5 minutes, the 300,000 is 5 minutes in 1/1000's of a second so 1000 is 1 second.

To get it to start after the computer turns on. Save the batch file then drag and drop it in the folder Startup which is located at
Start menu - All Programs - Startup

This will add a shortcut to that start up folder, which will run that batch file on start up

I feel this is the quickest way to do that.


@Holla or anyone else who knows

I've seen the ping -n 300 used before to pause a script. I'm wondering does that give you an exact time or not? I looked up the -n and that just means count so does each ping last 1 sec exact?


0

Response Number 3
Name: raygate
Date: November 21, 2008 at 06:57:58 Pacific
Reply:

.. my requst is the same idea of CD's autorn..

aqutuly ... I want to put a batch in my flash memory (removabl flash disk) ..

this batch work after (e.g: 3 menits) of plage it to the cpmputer and starting make bakeup to my dicuments (ppt and boc files)..


0

Response Number 4
Name: pball
Date: November 21, 2008 at 16:19:01 Pacific
Reply:

i'm sorry to inform you that windows xp does not support autorun on usb flash drives

You can create an autorun.inf file and have it give you options in the normal popup that usually appears when a flash drive is plugged in.

So you could add the backup option to the autorun pop but not have it automatically start like a cd does

just search google for autorun on usb drive


0

Response Number 5
Name: Mechanix2Go
Date: November 21, 2008 at 23:24:54 Pacific
Reply:

pball,
I timed it and got 304.8362

This did a little better:

ping -n 1 -w 300000 1.1.1.1

300.1126 seconds

Your mileage may vary.


=====================================
If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Response Number 6
Name: raygate
Date: November 21, 2008 at 23:41:59 Pacific
Reply:


pball ..
I thinke u r right .. I have to create an autorun.inf file that have order to open batch file have the order((
@Echo Off

xcopy /s C:\*.ppt F:\mystuff\
))

but I don't know how to set time in autorun.inf file to open ((e.g:ppt copy.bat))
file ..

can some one help me to create an autorun.inf file run a batch file after 5 minte>>!!


0

Response Number 7
Name: Holla
Date: November 23, 2008 at 21:49:26 Pacific
Reply:

About ping -n 1 -w 300000 1.1.1.1
Using this as a delay mechanism may work on some machines and may not on some others.

I think it depends on how your DNS/router/gateway is configured.
For example, I get a ping reply from 1.1.1.1 immediately.
For me, I can not connect to 1.1.1.1, but I get a ping reply within 140ms. I think the router is returning the ping reply because it is some kind of invalid ip?

I am on a DSL broadband connection.

--
Holla.


0

Response Number 8
Name: Mechanix2Go
Date: November 24, 2008 at 00:00:19 Pacific
Reply:

Holla,

I guess you're right that if the router returns a ping, all bets are off.


=====================================
If at first you don't succeed, you're about average.

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch can open automaticly

Batch File: Open HTM in current dir www.computing.net/answers/programming/batch-file-open-htm-in-current-dir/16423.html

Opened folder (batch) www.computing.net/answers/programming/opened-folder-batch/16125.html

Open PuTTY Secure FTP using batch www.computing.net/answers/programming/open-putty-secure-ftp-using-batch/17306.html