fidel Posted April 2, 2008 Report Share Posted April 2, 2008 Hello,i am trying to do the following on a Windows XP Prof. SP2 machine:--1. While Shutdown start a .bat file2. Bat file unmapps network drives3. Bat file remaps a specific network drive4. Bat file backups some data to the newly mounted backup/network drive.--Well thats the theoryAs using planed tasks in XP are not able to be executed while running shutdown i was forced / or feel'd forced to use this method:--* Start* Run * gtmedit.msc* Computer configuration* Windows Settings* Scripts* Shutdown --to execute my batch file.Well my batch file itself works if i do execute it while PC is in normal usage / running but it seems like it does not work If i do execute the script like mentioned above.Does not work means: script is executed but seems to have problems handling the network.If i change the script to a local copy (not network based) it works totally.So, as i am new to the mentioned method to run scripts while shutdown: IS there a known problem to use network-shares/mounts via "net use" in this state of shutting down a XP machine ?any ideas ?Feedback is heavily appreciated.Thanksfidel Quote Link to comment Share on other sites More sharing options...
fidel Posted April 2, 2008 Author Report Share Posted April 2, 2008 forgot to add the script:--REM unmount drivenet use z: /deleteREM remount drivenet use z: \\IP\SHARE /User:myusername passwordREM tried both remount ideasREM net use z: \\IP\Share password /User:myusernameREM lets do some copy actionxcopy /s /y "C:\bla\blub\*" Z:\Backup-- Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted April 3, 2008 Report Share Posted April 3, 2008 As using planed tasks in XP are not able to be executed while running shutdown ...Can you be a little bit more specific why you are "not able" to run your shutdown script? Any error messages, or what? Quote Link to comment Share on other sites More sharing options...
fidel Posted April 3, 2008 Author Report Share Posted April 3, 2008 As using planed tasks in XP are not able to be executed while running shutdown ...Can you be a little bit more specific why you are "not able" to run your shutdown script? Any error messages, or what?Hi regarding using default Tasks: Default planned Tasks dont offer an "execute on shutdown optinon" at all. Regarding the idea to use gpedit -> shutdown scripts:well the script itself is executed, but it seems like i.e some commands dont work at this stage.Means: the map'ing of the network drive writes no output to my log ..... which logs each batch file command. (not included in the example above)So basically i am just asking if i am correct and that using this way to execute bat files during shutdown is limited or not.best regardsfidel Quote Link to comment Share on other sites More sharing options...
fidel Posted April 3, 2008 Author Report Share Posted April 3, 2008 As using planed tasks in XP are not able to be executed while running shutdown ...Can you be a little bit more specific why you are "not able" to run your shutdown script? Any error messages, or what?Hi regarding using default Tasks: Default planned Tasks dont offer an "execute on shutdown optinon" at all. Regarding the idea to use gpedit -> shutdown scripts:well the script itself is executed, but it seems like i.e some commands dont work at this stage.Means: the map'ing of the network drive writes no output to my log ..... which logs each batch file command. (not included in the example above)So basically i am just asking if i am correct and that using this way to execute bat files during shutdown is limited or not.best regardsfidelwell somehow solved.Works if i use gpedit to add a user logoff script but not a machine shutdown scriptguess my basic idea was correct regarding using net use during shutdown stage.thanks anyways Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted April 3, 2008 Report Share Posted April 3, 2008 I have not used a shutdown script myself, but I know it *should* be working, as it should be run before the actual shut down is initiated.See here http://www.windows-help-central.com/window...own-script.html for one of the many documents on the Internet. Quote Link to comment Share on other sites More sharing options...
fidel Posted April 3, 2008 Author Report Share Posted April 3, 2008 I have not used a shutdown script myself, but I know it *should* be working, as it should be run before the actual shut down is initiated.See here http://www.windows-help-central.com/window...own-script.html for one of the many documents on the Internet.hehe.Thanks for research. but basicly you can try that pretty easy yourself ( if you are interessted)I have choosen this method at beginning as i expected it to work too.After several shutdown und restart i had enough and used a working alternative as mentioned above (using the logout idea).i dont think it does work with all functions (using the shutdown idea)....cause otherwise my backup would be executed.anyway. Thanks for response.Best regardsfidel Quote Link to comment Share on other sites More sharing options...
Scarecrow Man Posted April 3, 2008 Report Share Posted April 3, 2008 It may have something to do with as the computer shuts down, all network connections are closed, but during a log off they are maintained. This may simply not be available as a shutdown script. Quote Link to comment Share on other sites More sharing options...
Noob007 Posted December 11, 2010 Report Share Posted December 11, 2010 May Be This Will Be Useful.........../>http://diaryofexperience.blogspot.com/search/label/Run%20Script%20On%20Shutdown Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted December 12, 2010 Report Share Posted December 12, 2010 What's the point of resurrecting a 2½ year old topic...? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.