Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).![]() |
![]() |
|
Thread Tools |
![]() |
#1 |
Guest
Posts: n/a
|
![]()
I have a batch file that needs to run about 1 min after windows has booted up to the desktop?
Looking at the DELAY command but don't seem to work. Any ideas? |
![]() |
![]() |
#2 |
Guest
Posts: n/a
|
![]() |
![]() |
![]() |
#3 |
Guest
Posts: n/a
|
![]()
There is no simple way to make the process sleep for a set time without an external utility.
However as a workaround insert a line similar to this: ping 1.1.1.1 -n 60 -w 1000 > null This will ping a non existent address 60 times with a 1000ms timeout with the result of causing a 1 minute delay. It will redirect the ping output to null so that the ping will not display any output on screen. HTH |
![]() |
![]() |
#4 |
Guest
Posts: n/a
|
![]()
didn't there used to be a pause function - press any key to continue thingy?
|
![]() |
![]() |
#5 | |
Member
Mega Poster
Join Date: Jul 2006
Location: Sunny Croydonia
Posts: 6,124
|
![]() Quote:
in pseudocode while (loop!=1) { get uptime if uptime < 60 { sleep 10 } else { loop=1 } do stuff end
__________________
Sent from my PC NOT using any Tapatalk type rubbish!! █╬╬╬╬(•)i¯i▀▀▀▀▀█Ξ███████████████████████████████) Last edited by SoulKiss; 04-06-09 at 04:17 PM. |
|
![]() |
![]() |
![]() |
#6 | |
Guest
Posts: n/a
|
![]() Quote:
![]() ![]() |
|
![]() |
![]() |
#7 |
Member
Mega Poster
Join Date: Jul 2006
Location: Sunny Croydonia
Posts: 6,124
|
![]()
Well I have no idea what can cannot be done on a Windows platform - I dont code for that.
But if he can work out how to get a windows box to tell him how long its been up for, then can use that in a comparison, then what I have written WILL help - hence pseudocode and not Perl You really should change your nick to [pedant]Baph[/pedant] ![]() Oh wait, got to go throw some stones from my glass house ![]()
__________________
Sent from my PC NOT using any Tapatalk type rubbish!! █╬╬╬╬(•)i¯i▀▀▀▀▀█Ξ███████████████████████████████) |
![]() |
![]() |
![]() |
#8 |
Member
Mega Poster
Join Date: Jan 2004
Location: Whyteleafe
Posts: 3,395
|
![]()
you can record and test the %TIME% variable for 1 minute elapsed.
The question i'd be asking is why do you want something to run 1 minute after login. If we know the nature of what you're trying to achieve, perhaps there's a more elegant way to achieve it?
__________________
Silver SV650SK3, Fuel exhaust |
![]() |
![]() |
![]() |
#9 |
Guest
Posts: n/a
|
![]() |
![]() |
![]() |
#10 | |
Guest
Posts: n/a
|
![]() Quote:
I needed this because I had the following situation:- PC is on a WORKGROUP network, separate from the DOMAIN network. Needs to print to the DOMAIN printer, so connecting the Network Printer via IP address works, but once the PC was rebooted and you tried to access the printer, it came back with the error message Access Denied. Even if I add the Group EVERYONE Full Control rights to the SHARED printer, it still doesn't connect. The only way I found to be able to access the printer after the PC had rebooted was running the following unattended command:- net use \\IP ADDRESS of Server\Printer Share Name /USER:Administrator@Domain Password /persistent:yes So now, I have now added the ping 1000 command to the beginning of the script as supplied by RatchJob, and this delays enough time for all services to start and the command to complete successfully. |
|
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New Test Delay 6 months | Nostrils | Bikes - Talk & Issues | 1 | 11-09-08 08:00 PM |
Brands Hatch - 24-4-08 First Batch | Mr Toad | Photos | 22 | 25-04-08 11:06 PM |
BBC Sport: Bad weather causes Manx GP delay | NewsBot | News | 0 | 31-08-07 03:40 PM |
BBC Sport: Mist causes further delay to TT | NewsBot | News | 0 | 04-06-07 08:00 AM |
Batch converting Adobe pdf | tomjones2 | Idle Banter | 1 | 17-03-06 03:16 PM |