Sean
Wed Nov 08 14:49:55 CST 2006
D,
Thanks for the quick response, I guess I should have been more specific.
The >nul does not display the time, however, I don't want any black cmd box
opening. Is there a way to run that hidden?
Thanks, Sean
"dNagel" <NOTGrandNagel@NotMail.com> wrote in message
news:OECa7V3AHHA.204@TK2MSFTNGP04.phx.gbl...
> See inline comments
>
> D.
>
> Sean Grieco wrote:
>> D,
>>
>> That's a freakin' awesome script, it does the trick. However, I have a
>> few quick questions.
>>
>> 1. Is there a way that the cmd box does not splash the time?
>>
>>
> When you first execute the script call it like this
> c:\sounds\new3.bat > nul
>
>> 2. Can it be setup to delete all scheduled tasks first? Right now the
>> way it is setup if you reboot it keeps the last task there, so when you
>> log back in you have 2 tasks running, then the next time you have 3, etc.
>>
> to delete a scheduled task you call AT with the number of the task...
> AT 13 /delete
>
> to delete all tasks use
> AT /delete
>
> If you delete all tasks then you possibly break their scheduled virus
> scans or whatever else they were using
> the scheduler for outside of this task.
> .
> It would seem that in your login script that you should check to see if
> you've already run this script.
> One way would be to create a file in the script. This allows you to check
> for a file to exist and decide
> if you want to run the script or fall out.
>
> :: Login Script usage example -- c:\sounds\new4.bat CHECKME > nul
> ::if we get a %1 (1st passed param == CHECKME)
> :: then we know you want to see if we should run
> :: this means if the key file exists then just
> :: fall out and do nothing
> @ECHO off
> SET KeyFile=%temp%\Done.yet
>
> if "%1"=="CHECKME" goto CHECKME
> GOTO DOIT
>
> :CHECKME
> if exist %KeyFile% goto MESSAGE :: we know the intial execution is done.
>
> :DOIT
> echo.We Exist!>%KeyFile%
> SETLOCAL
> SET v_vbs=%temp%\~tmp.VBS
> SET v_cmd=%temp%\~tmp.cmd
> ECHO Set oFS=CreateObject("Scripting.FileSystemObject")>%v_vbs%
> ECHO tim=FormatDateTime(now+1/(1440/10),vbShortTime)>>%v_vbs%
> ECHO oFS.CreateTextFile("%v_cmd%",2).Write "set v_input=">>%v_vbs%
> ECHO oFS.OpenTextFile("%v_cmd%",8).Write tim>>%v_vbs%
> cscript.exe //nologo %v_vbs%
> CALL %v_cmd%
> DEL %v_vbs%
> DEL %v_cmd%
> SET v_input
> ENDLOCAL & SET v_input=%v_input%
>
> ECHO RUN THE REAL CODE
> At %v_input% /interactive "%0" > nul
>
> :MESSAGE
> ::already initialized the loop code so just fall out
>> 3. Can these tasks be hidden when created? That way the user does not
>> see and cannot delete it....
>>
>
http://groups.google.com/group/microsoft.public.windowsxp.general/browse_thread/thread/564ff2bbac76c6cb/8c2d590818e6a2c2?lnk=st&q=hide+scheduled+tasks+from+the+user&rnum=1&hl=en#8c2d590818e6a2c2
>
>> Thanks again, great script!
>>
> Thanks,
>
> D.