smercer Posted April 18, 2005 Posted April 18, 2005 Hi allI was wondering if there was a way to have scripts run before a windows 98 system is shut down.The Idea is to delete temp files, delete intenet tempory files, cookies etc, start a registry check program, start the scandisk and when finished, run the disk defragmenter if any files in a partition were modifyed since last boot up.I have seen batch scripts executed on computers at collage and thought I could do all this.Could someone please help me here? thanks in addvance!!!
dman Posted April 18, 2005 Posted April 18, 2005 in xp you can set this in policy editor. i think 98 has this as well (poledit.exe).
smercer Posted April 18, 2005 Author Posted April 18, 2005 in xp you can set this in policy editor. i think 98 has this as well (poledit.exe).<{POST_SNAPBACK}>I did all you said but can't find it. even used the find utillity.Thanks for your help
dman Posted April 18, 2005 Posted April 18, 2005 yeah, sorry. I was thinking xp, I didn't notice the 98 til after I read it again. you have to install poledit in 98 options, but thinking about it I don't remember this option for shutdown. My 98 partition is stripped for gaming, so I don't have it installed anymore either so can't check. someone must make a 3rd party tool for this, it seems like it would be a common task.Edit: you could try a script to do your tasks then run "rundll.exe user.exe,exitwindows"
smercer Posted April 18, 2005 Author Posted April 18, 2005 yeah, sorry. I was thinking xp, I didn't notice the 98 til after I read it again. you have to install poledit in 98 options, but thinking about it I don't remember this option for shutdown. My 98 partition is stripped for gaming, so I don't have it installed anymore either so can't check. someone must make a 3rd party tool for this, it seems like it would be a common task.Edit: you could try a script to do your tasks then run "rundll.exe user.exe,exitwindows"<{POST_SNAPBACK}>Thanks...I wanted to be able to execute it from the start menu and shutdown dialog box. is there a way of doing it like this?Thanks again.
dman Posted April 18, 2005 Posted April 18, 2005 you could add a shortcut to the start menu trunk that calls your script. dont think you could easily get it into shutdown dialog. maybe 3rd party tool.
eidenk Posted April 18, 2005 Posted April 18, 2005 Nice little proggie : http://www.xpertdesign.de/english/sw_xecutor_info.htm
Fredledingue Posted April 22, 2005 Posted April 22, 2005 The best solution would be a VBScript that launch a BAT or another VBS script , then launch the shutdown the dialog box.While you move your mouse to the "shut down" button, the script should have had the time to do the task expected.It's easy to do, but I don't have the codes here, and I don't have the time neither, but i will look for something next weeK.Stay tuned...
Fredledingue Posted April 29, 2005 Posted April 29, 2005 This script should launch Scandisk, wait 7 minutes, then shutdown the computer.There is a "yes-no-cancel" button.It should be possible to launch more apps one after one in the same script.Copy paste the code in notepad and save it as "MyShutdown.vbs"Then double-clic on it.To run the scripts you need maybe Windows Script 5.6. (included in Gape's unofficial service pack)Please tell me if it works. Set WshShell = WScript.CreateObject("WScript.Shell") BtnCode = WshShell.Popup("This computer will shut down."_ & vbCrlf & "Before shutting down, Scandisk will check your hard drive."_ & vbCrlf & _ vbCrlf & "Start ScanDisk before shutting down --> Clic ""Yes"""_ & vbCrlf & "Don't launch Scandisk --> Clic ""No""" , 30, Title, 3 + 16) Select Case BtnCode '---no answer case -1 WshShell.Popup "ScanDisk will now start. Don't touch the mouse or the keyboard!", 3, Title, 0 + 16 WshShell.Run("ScanDisk") WScript.Sleep 1500 WshShell.SendKeys("{ENTER}") WScript.Sleep 420000 '-------7 minutes = 420000 ms WshShell.SendKeys("{ENTER}{ENTER}") WScript.Sleep 250 '---yes case 6 WshShell.Popup "ScanDisk will now start. Don't touch the mouse or the keyboard!", 3, Title, 0 + 16 WshShell.Run("ScanDisk") WScript.Sleep 1500 WshShell.SendKeys("{ENTER}") WScript.Sleep 420000 '-------7 minutes = 420000 ms WshShell.SendKeys("{ENTER}{ENTER}") WScript.Sleep 250 '---no case 7 WshShell.Popup "ScanDisk canceled.", 3, Title, 0 '---cancel case 2 wscript.quit End SelectWshShell.Run "C:\WINDOWS\RUNDLL32.EXE shell32.dll,SHExitWindowsEx 1", 2, false
smercer Posted April 30, 2005 Author Posted April 30, 2005 Please tell me if it works. Thanks for that, I will try that tonight after I hop of the internet, as I am still on dial up.Edit: I tryied it last night and it had an error and did not shutdown. Don't worry about fixing it anyway, as I got my own batch file working. Sorry I forgot to notify you, but I did mention it in other posts and lost track of the posts I had asked help for about it.By the way if you want the batch file I will attach it.
MDGx Posted May 1, 2005 Posted May 1, 2005 Ways to run stuff before Windows 9x/ME [ME needs mfd4life Real DOS patch] shuts down or before it starts up:1. Add lines to C:\autoexec.bat if appropriate for your programs to run from native MS-DOS.2. If they need to run from within Windows UI, run them from the RunOnceEx registry key by running a REG or INF file from within a BATch file, which [bATch] can also shut down Windows as last command:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx3. Get AutoIt v3.1.1 32-bit for Windows 9x/NT4/2000/ME/XP/2003 BASIC-like scriptinglanguage automates Windows + DOS session tasks + software installations,simulates commands, key presses, mouse movements + clicks, includes script toexecutable converter, highly customizable:http://www.autoitscript.com/autoit3/Direct download [1.7 MB, free, open source]:http://www.autoitscript.com/files/autoit3/...it-v3-setup.exeHope this helps.
Fredledingue Posted May 1, 2005 Posted May 1, 2005 Edit: I tryied it last night and it had an error and did not shutdown.Just for curiosity (because I may want to do it for myself too), can you post the error message here?Here the script have no error but I didn't try it to shutdown.By the way if you want the batch file I will attach it.Yes, you can copy-paste the code in the message and frame it with CODE.--------------------MDGx Ways to run stuff before Windows 9x/ME [ME needs mfd4life Real DOS patch]shuts down or before it starts up:1. Add lines to C:\autoexec.bat if appropriate for your programs to run from native MS-DOS.Does autoexec.bat do anything before shutdown?2. If they need to run from within Windows UI, run them from the RunOnceEx registry key by running a REG or INF file from within a BATch file, which [bATch]can also shut down Windows as last command:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceExCould you elaborate?Seems very complicated what you said.3. Get AutoIt yes, very good stuff. You can also use AutoIt for adding functions to VBS.
MDGx Posted May 2, 2005 Posted May 2, 2005 MDGxWays to run stuff before Windows 9x/ME [ME needs mfd4life Real DOS patch] shuts down or before it starts up:1. Add lines to C:\autoexec.bat if appropriate for your programs to run from native MS-DOS.Does autoexec.bat do anything before shutdown?2. If they need to run from within Windows UI, run them from the RunOnceEx registry key by running a REG or INF file from within a BATch file, which [bATch]can also shut down Windows as last command:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceExCould you elaborate?Seems very complicated what you said.3. Get AutoIt yes, very good stuff. You can also use AutoIt for adding functions to VBS.1. Autoexec.bat [if present] runs every time before Windows UI starts up.2. The RunOnceEx registry key runs any program you specify [even DOS BATCH files] every time while Windows UI loads, but before other programs/TSRs/processes load/run from "Run" registry keys, WIN.INI "load=xxxxx" or "run=xxxxx" lines or from the Startup folder.Example: this INF file adds a bunch of RunOnceEx commands which will be executed in the background next time Windows UI will load [CS.INF is part of 98SE2ME = http://www.msfn.org/board/?showtopic=37302 ]:[Version]Signature="$CHICAGO$"[DefaultInstall]AddReg=R[R]HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","0",2,"%11%\SHDOCVW.DLL|DllRegisterServer"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","1",2,"%11%\SHDOCVW.DLL|DllInstall|i"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","2",2,"%11%\SHELL32.DLL|DllInstall|i"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","3",2,"%11%\SHELL32.DLL|DllRegisterServer"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","4",2,"%11%\WEBVW.DLL|DllRegisterServer"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","5",2,"%11%\BROWSEUI.DLL|DllRegisterServer"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","6",2,"%11%\BROWSEUI.DLL|DllInstall|i"HKLM,"Software\Microsoft\Windows\CurrentVersion\RunOnceEx\1","7",2,"%11%\MYDOCS.DLL|DllRegisterServer"[SourceDisksNames]1=,,0To add these commands into the registry, run CS.INF from a BATch file:@echo offSTART/W RUNDLL32 %windir%\SYSTEM\ADVPACK.DLL,LaunchINFSection CS.INF,DefaultInstallclsexit3. Indeed, AutoIt is 1 cool app.Highly customizable, u can run anything, anytime.4. Another way to run programs after Windows shuts down, is to follow the steps detailed at these pages:http://www.mdgx.com/last3.htm#DOS2DOShttp://www.mdgx.com/lastweek.htm#MSDOSPROMPThttp://www.mdgx.com/newtip1.htm#DOShttp://www.mdgx.com/98-4.htm#98ATXin order to be able to exit Windows to native MS-DOS, like I do. Then you need to run Windows from within a batch file, I like to call WIN.BAT [in C:\ root = make sure to add C:\ root to your PATH statement into autoexec.bat or config.sys].Example [deltemp.bat can contain lines to "clean out" all your TEMP, TMP, MS IE TIF, Cookies, History, Mozilla/Netscape/Opera Cache directories, delete APPLOG folder, scandisk all your fixed drives/partitions, scanreg the registry for errors + repair them, delete specific registry keys, upload keys/values into the registry, etc... use your imagination]:@echo offmem/c | find/i "vmm32">nulif not errorlevel 1 goto end%winbootdir%\win.com %1 %2 %3call C:\deltemp.bat:endclsexitAnd if at the end of all this u want to shut down your computer, unload NOOFF.COM from memory [if present]:NoOff v1.4 16-bit DOS TSR prevents computer power off by disabling BIOS ACPI"soft-off" function forcing Windows 95/OSR2/98/98 SE to exit to native MS-DOSupon shut down on ATX motherboards:http://home.arcor.de/g.s/dostools.htmDirect download [279 B, freeware, right-click to save!]:http://home.arcor.de/g.s/nooff.comNOOFF.COM uses 336 Bytes of upper DOS RAM if loaded with LOADHIGH inAUTOEXEC.BAT (upper memory manager required in CONFIG.SYS).Does NOT work with Windows ME!See "WIN98 ATX SHUT DOWN FIX" for details:http://www.mdgx.com/98-4.htm#98ATXand then run [from the same batch file] ATXOFF.COM:http://home.arcor.de/g.s/dostools.htmor:WIN.COM /Z
Fredledingue Posted May 2, 2005 Posted May 2, 2005 MDGxJust to make sure you speak english and not chinese:in order to be able to exit Windows to native MS-DOS, like I do. Then you need to run Windows from within a batch file,Do you mean making a transition to an MS-DOS state between windows tasks end down and the power goes off, or do you mean restarting or sort-of restarting in MS-DOS mode, with a set of batch files?Then how do run windows "from withion a batch file" if you exited windows?In my conception, you can run only DOS program in DOS, windows program require windows... or that means that windows is still active somehow...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now