If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
I have a .BAT file that maps my drive shares and I want to run it each
time the machine boots up. Problem is that one of the services maps to a NAS box using Windows credentials and I need to map my shares using the NAS box's credentials. It works A-OK if I reboot, manually stop the service, and then run the ..BAT file.... I am thinking that it is something with "Run" registry entrees as described in https://msdn.microsoft.com/en-us/library/windows/desktop/aa376977(v=vs.85).aspx, but sequence would seem to be the critical factor. I do see references to some familiar startup apps in HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run, but they are just arranged alphabetically - no indication of sequence...or does the name of the key determine sequence by it's alphabetic value? All that being said, does anybody know how to force the sequence that "Run" registry entries are executed in? Or am I on the wrong track? -- Pete Cresswell |
Ads |
#2
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On Sat, 07 Mar 2015 10:51:17 -0500, (PeteCresswell) wrote:
I have a .BAT file that maps my drive shares and I want to run it each time the machine boots up. Problem is that one of the services maps to a NAS box using Windows credentials and I need to map my shares using the NAS box's credentials. It works A-OK if I reboot, manually stop the service, and then run the .BAT file.... I am thinking that it is something with "Run" registry entrees as described in https://msdn.microsoft.com/en-us/library/windows/desktop/aa376977(v=vs.85).aspx, but sequence would seem to be the critical factor. I do see references to some familiar startup apps in HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run, but they are just arranged alphabetically - no indication of sequence...or does the name of the key determine sequence by it's alphabetic value? All that being said, does anybody know how to force the sequence that "Run" registry entries are executed in? Or am I on the wrong track? Could you run the desired stuff from inside the batch file? Otherwise, I think there is a certain priority already, e.g maybe registry entries run before Startup folder entries (or not). You cold also start the program (that you want to delay) from the task scheduler, set it to Run at Startup and specify the delay you'd like. -- Gene E. Bloch (Stumbling Bloch) |
#3
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
Per Gene E. Bloch:
You cold also start the program (that you want to delay) from the task scheduler, set it to Run at Startup and specify the delay you'd like. I think we have a winner.... Thanks! -- Pete Cresswell |
#4
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On Sat, 07 Mar 2015 15:42:43 -0500, (PeteCresswell) wrote:
Per Gene E. Bloch: You cold also start the program (that you want to delay) from the task scheduler, set it to Run at Startup and specify the delay you'd like. I think we have a winner.... Thanks! Notice it was the last thing I mentioned - because it took me a while to think of it :-) I've thought a little about that problem, but never actually solved it for myself, so my ideas are buried a little bit in the mental archives. It would be great if it works... -- Gene E. Bloch (Stumbling Bloch) |
#5
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
"Gene E. Bloch" wrote in message ... On Sat, 07 Mar 2015 15:42:43 -0500, (PeteCresswell) wrote: Per Gene E. Bloch: You cold also start the program (that you want to delay) from the task scheduler, set it to Run at Startup and specify the delay you'd like. I think we have a winner.... Thanks! Notice it was the last thing I mentioned - because it took me a while to think of it :-) I've thought a little about that problem, but never actually solved it for myself, so my ideas are buried a little bit in the mental archives. It would be great if it works... I was having a similar problem, and resorted to Startup Delayer http://www.r2.com.au/page/products/download/startup-delayer/. Worked well for me, but I am in no way saying it will be a solution for everyone :-) -- SC Tom |
#6
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
Per Stormin' Norman:
Peter, out of curiosity, what is the make and model of NAS. I have not encountered an NAS that requires a service to be installed on a client machine for authentication. NetGear Ultra-6. For the regular shares it allows a connection using just the Windows ID/PW or, I think, even anonymous connections. But if I want a connection to the "Admin" share - which includes my "Home" directory - I have to supply the NAS box's "Admin" ID and PW. The problem comes when my Tivo-on-steroids TV/Movie application's service automagically starts at boot time. The TV/Movie app connects to the NAS box on it's own using, I guess, the Windows PC's credentials. Once that had been done, I cannot map a drive to that same NAS box using the NAS box's Admin credentials..... some sort of Windows thing, I think, because there is no problem doing that with my Android devices. Bottom line, I want to create those drive mappings at Startup time before the TV/Movie app's service starts. Gene's approach of manually starting the TV/Movie service instead of letting it start itself makes the most sense to so far - because I can embed that service's startup in the same .BAT file that maps the drive....just make come after the drive mappings. -- Pete Cresswell |
#7
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
Per Stormin' Norman:
What is the actual name of the Tivo like application you are running? SageTV. Bought out by Google, who killed it - using, I guess, the development staff to work on Google's functional analog. -- Pete Cresswell |
#8
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On Sun, 8 Mar 2015 07:55:49 -0400, SC Tom wrote:
"Gene E. Bloch" wrote in message ... On Sat, 07 Mar 2015 15:42:43 -0500, (PeteCresswell) wrote: Per Gene E. Bloch: You cold also start the program (that you want to delay) from the task scheduler, set it to Run at Startup and specify the delay you'd like. I think we have a winner.... Thanks! Notice it was the last thing I mentioned - because it took me a while to think of it :-) I've thought a little about that problem, but never actually solved it for myself, so my ideas are buried a little bit in the mental archives. It would be great if it works... I was having a similar problem, and resorted to Startup Delayer http://www.r2.com.au/page/products/download/startup-delayer/. Worked well for me, but I am in no way saying it will be a solution for everyone :-) You remind me that I've heard of such programs (just not recently). It sounds like a useful thing for (Pete to try. -- Gene E. Bloch (Stumbling Bloch) |
#9
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On Sun, 08 Mar 2015 16:04:23 -0400, (PeteCresswell) wrote:
Per Stormin' Norman: What is the actual name of the Tivo like application you are running? SageTV. Bought out by Google, who killed it - using, I guess, the development staff to work on Google's functional analog. Yeah, I was trying to set up a home theater or media center operation a year or two ago, & SageTV looked like just the thing, its only flaw being that it was already dead by then :-) -- Gene E. Bloch (Stumbling Bloch) |
#10
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
Per Gene E. Bloch:
Yeah, I was trying to set up a home theater or media center operation a year or two ago, & SageTV looked like just the thing Yeah... it *was* the thing.... Best feature was the little black boxes for driving a TV. They take 5-6 watts, and give complete access to the server: movies, recorded TV... and the UI is customizable so one can un-dumb-down the menus to a significant extent. I dunno what I'm going to do if/when it finally breaks.... But the world moves on..... and there is always Microsoft Media Center (or whatever they call it...). Actually, I would think that SageTV would still be an option for somebody determined. They've lightened up on the license scene and licenses are being bought and sold on a sort of "Used" market. I also see the little black boxes for sale. There was one alternative called MythTV that ran on Linux. I dabbled in it for awhile and have to say that it was comparable to Sage when it worked - except that one needed a PC under the TV instead of the little black box. OTOH, very small and silent PCs seem to be on the rise lately - although I don't think they are as cheap as the $200-300 SageTV devices. Problem for me was that Linux was like having a part-time job except that the pay was lousy..... To be fair, though, others swear by MythTV and I would think it should be on everybody's list if they are looking... -- Pete Cresswell |
#11
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On Sun, 08 Mar 2015 21:33:58 -0400, "(PeteCresswell)" wrote:
Actually, I would think that SageTV would still be an option for somebody determined. They've lightened up on the license scene and licenses are being bought and sold on a sort of "Used" market. I also see the little black boxes for sale. Where is this market? Maybe I'll sell my SageTV license one day. -- Char Jackson |
#12
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
Per Char Jackson:
Where is this market? Maybe I'll sell my SageTV license one day. In one of the Sage fora: http://forums.sagetv.com/forums/ Right here, right now I could go for another Client license. IIRC they're going for something like twenty dollars. -- Pete Cresswell |
#13
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On 2015-03-08 11:22, (PeteCresswell) wrote:
The problem comes when my Tivo-on-steroids TV/Movie application's service automagically starts at boot time. The TV/Movie app connects to the NAS box on it's own using, I guess, the Windows PC's credentials. Once that had been done, I cannot map a drive to that same NAS box using the NAS box's Admin credentials..... some sort of Windows thing, I think, because there is no problem doing that with my Android devices. You can always try to delete the map before you map it yourself, and then do the klist purge: NET USE PathToNAS /DELETE NET USE PathToNAS\ipc$ /DELETE klist purge See he http://serverfault.com/questions/451...n-a-windows-ma You're right, it's a windows thing, annoys me regularly at work. Best Regards, -- ! _\|/_ Sylvain / ! (o o) Member-+-David-Suzuki-Foundation/EFF/Planetary-Society-+- oO-( )-Oo Windows error 08 Broken window, watch for glass fragments. |
#14
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
On Mon, 09 Mar 2015 12:58:26 -0400, "(PeteCresswell)" wrote:
Per Char Jackson: Where is this market? Maybe I'll sell my SageTV license one day. In one of the Sage fora: http://forums.sagetv.com/forums/ Right here, right now I could go for another Client license. IIRC they're going for something like twenty dollars. Thanks for the info. I think I saw a note asking people to delete their For Sale threads after the deal is complete, so I wasn't able to see any history. -- Char Jackson |
#15
|
|||
|
|||
Startup: Running .BAT or .CMD Before Services Started?
Per B00ze/Empi
You can always try to delete the map before you map it yourself, and then do the klist purge: klist purge Sweet!... cuts right to the chase, and the Tivo-type application is not affected. No re-boots necessary, can be run at any time. KLIST = something to do with Kerberos' list. IIRC from the IBM mainframe days, Kerberos was the three-headed dog that guarded the gates of hell in Greek mythology - and it's name was appropriated by IBM for some part of their mainframe security system. FWIW, here's the final product: ================================================== ================================== :* ---------------------------------------------------- :* Deletes, then re-establishes connections :* using NAS box's Admin ID... which gets :* us access to the "Admin" share, as opposed :* to using the Windows' ID which does not. NET USE * /DELETE /yes KLIST purge CMDKEY /add:NAS /user:Admin /pass:xxxxxx NET USE A: \\NAS\A /savecred /p:yes NET USE T: \\NAS\Temp /savecred /p:yes NET USE H: \\NAS\PeteCress /savecred /p:yes NET USE O: \\NAS\B\DVDs_Owned /savecred /p:yes NET USE L: \\NAS\B\DVDs_Library /savecred /p:yes NET USE N: \\NAS\B\DVDs_NetFlix /savecred /p:yes NET USE S: \\NAS\B\Streamed_NetFlix /savecred /p:yes PAUSE ================================================== ================================== Thanks!!!! -- Pete Cresswell |
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|