#180863 - 2007-09-26 05:00 PM
Displaying text in the console
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
Hi all
I hope you can help. Done a bit of hunting with no luck ;-(
I have a script which runs for one group only. Depending on the amount of data which needs to be deleted the kix console will stay open for a while. I would like text to appear within the console explaining to the user the delay and normal work can continue. Don't try and close the window blah blah.
FYI: I can get MessageBox to work OK but I dont want that, becasue it's an aditional click for the user etc etc
Any ideas?
My code
IF instr ($grp, "test") Run '\\itukdc01\NETLOGON\wdsuk\delprof\delprof.exe /I /Q /D:30' Endif
|
|
Top
|
|
|
|
#180866 - 2007-09-26 05:32 PM
Re: Displaying text in the console
[Re: mikeruss]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Some suggestions
- Use wkix32.exe
- SetConsole("Hide")
? "Please wait while deleting user profiles"
Run '\\itukdc01\NETLOGON\wdsuk\delprof\delprof.exe /I /Q /D:30'
; Don't you need admin rights to delete profiles?
|
|
Top
|
|
|
|
#180868 - 2007-09-26 05:44 PM
Re: Displaying text in the console
[Re: Witto]
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
thanks for the quick response.
I've already tried
? "Please wait while deleting user profiles"
with no luck ;-( Any other ideas?
"Don't you need admin rights to delete profiles?"
I will write another script which will use psexec to get around perms issues.
Edited by mikeruss (2007-09-26 05:44 PM)
|
|
Top
|
|
|
|
#180872 - 2007-09-26 06:17 PM
Re: Displaying text in the console
[Re: Glenn Barnas]
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
Witto - no luck again... could be me being bumb? But... Glenn, that works a treat I'll run with that. See if the users compalin ;-)
Many many thanks all
MIke
|
|
Top
|
|
|
|
#180874 - 2007-09-26 06:20 PM
Re: Displaying text in the console
[Re: mikeruss]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Break On ? "Please wait while deleting user profiles" Get $ |
And you do not get a console window??? I thought you did not want to use MessageBox() ?
|
|
Top
|
|
|
|
#180876 - 2007-09-26 06:21 PM
Re: Displaying text in the console
[Re: Witto]
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
The console always appears, but no txt. The console when using above code stay open and does not close until you hit enter??
Messagebox - Well no but the fact I can auto close...
Edited by mikeruss (2007-09-26 06:23 PM)
|
|
Top
|
|
|
|
#180948 - 2007-09-28 11:42 AM
Re: Displaying text in the console
[Re: Richard H.]
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
Hi again
Ok I am struggling with the fact delprof needs admin rights. psexec is not suitable because it needs a computer list to run against.
Does any one have any ideas?
|
|
Top
|
|
|
|
#180952 - 2007-09-28 12:45 PM
Re: Displaying text in the console
[Re: Richard H.]
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
Good idea.... but that means having a file with a password in plain txt on the LAN?
E.g.
SCHTASKS /Create /SC weekly /D MON,TUE,WED,THU,FRI,sat,sun /TN example /ST 09:30:00 /TR "\\script-application.exe /auto" /RU domain\name /RP *******
Edited by mikeruss (2007-09-28 12:47 PM)
|
|
Top
|
|
|
|
#180959 - 2007-09-28 02:21 PM
Re: Displaying text in the console
[Re: Witto]
|
mikeruss
Fresh Scripter
Registered: 2007-09-26
Posts: 7
|
cheers all - great help and info...
|
|
Top
|
|
|
|
#180967 - 2007-09-28 04:47 PM
Re: Displaying text in the console
[Re: Richard H.]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
[quote=Richard H.]Your only issue is if the password changes you will need to change it on all the machines, which is why I suggest that you use a local account or a service account whose password expiry is long.
Just as a point of reference, the tcLib UDF library has functions that make this situation very easy. If you have a list of systems, you can get a list of tasks from each system with one command, use a For/Next to enumerate each task, checking an array value for the presence of a particular user id, and - if found, use the SetCred UDF to change the credentials.
When we ran into this situation at my last job, the guys were crying that changing the sched-task account on 400 servers across 5 sites would take a week of work. With about 30 lines of code - most to enumerate domain computer accounts, filter out the workstations, and then enumerate the individual tasks, I had all tasks that used the task-sched account updated to use the new-task-sched account and password in less than an hour. Not a single task event was impacted!
The SchTask UDF is primarily designed to DEFINE a task event. It's quick, easy, and effective for this. The tcLib package is designed to MANAGE task events. It's simple, once you get the hang of the multiple UDFs, and very effective for analyzing and modifying task events.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 566 anonymous users online.
|
|
|