|
Hi everyone
I'm wondering what the syntax is for ending a script aft X seconds.
the reason being is one of our clients has a script that was written to do a system inventory but that script is causing log on times of 45 minutes at times. If I remove the script logon times are normal.
the script is as follows
start \\servername\ishareddiectory\inventoryapp.exe
so it is nothing fancy
I want to somehow say IF time running >= 30seconds Then Quit but I'm' not sure of what the syntax is and my knowledge of scripting is very limited
|
|
|
|
|
There is nothing built into the system that will do this.
Either that utility has to offer that functionality or you have to come up with an external utility that will watch for that .EXE and, if running for more than X seconds, terminate it. But, that could also lead to resource leaks and hung connections on servers.
|
|
|
|
|
I assume you are using a good old fashioned netlogon script or are using w2k computers.
Run the script as a group policy logon script instead. on Xp computers the script will run asyncronously and therefore it will not disturb so much.
If you are already using GPO script but you are having w2k computers, then the scripts are run syncronously. You may then want to set the timeout for the script at "Administrative templates/system/Scripts/Maximum wait time for Group Policy Scripts"
|
|
|
|
|
Can you do it via a Scheduled Task? It has the option for stopping the task after it has ran for X minutes/hours.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey Everyone,
Is there a way I can determine if the Windows Update is installing updates ?
Especially on Windows Vista and Windows XP
Thanks
|
|
|
|
|
check in the registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions
1=Disabled
2=Notify
3=Download but don't install
4=Download and install on schedule
This is valid for w2k and xp, I haven't checked for vista, but I have no reason to believe that it would be different
|
|
|
|
|
Do you know what registry key says we are using XP or VISTA?
|
|
|
|
|
HKLM\Software\Microsoft\Windows NT\Current Version\CurrentVersion => 5.1 for XP and 6.0 for Vista.
|
|
|
|
|
Thanks a lot!
|
|
|
|
|
Is there a known way to convert values from HKEY_CURRENT_USER\Control Panel\Keyboard\KeyboardSpeed to milliseconds?
Thanks in advance
|
|
|
|
|
Hi,
sure, seems KeyboardSpeed is a number in the [0, 31] range depending on Control Panel/Keyboard.
So set it at maximum, write a little program that accepts a line of text, hold down
the 'a' key for 10 seconds then hit ENTER, and let your program decide how may a's you've got.
Divide 10000 by it and that is the shortest key repeat period in msec.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi,
I have setup a Windows XP dial-up server(Control Panel->Networking->New Connection->Advanced->Accept Incoming connections). The connection works but the server (XP machine) uses CHAP protocol for authentification. How do I change it to PAP(it must be PAP)?
Thank you!
|
|
|
|
|
Hi,
I need to connect a PPP client device to a winXP machine using RS232 (COM5).
I have tried setting up a "Incoming connections" and using a standard 9600 bps modem on COM5 RS232 port.
The client send all kinds of PPP requests but the XP machine doesn't respond.
Any ideas, any custom software PPP server?
Thank you very much!
|
|
|
|
|
|
Hi,
As far as I know the main cause of such issue is Incompatible add-ons.
Try to run your IE7 without add ons.
Right click the IE icon on the desktop and choose Start Without Add-ons.
Or
Go to Start | All Programs | Accessories | System Tools | Internet Explorer (No Add-ons).
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
i gonna make my question as clear as I can.
I want to change text of tabs and other text inside window of DirectX example
in tab System i have text Computer Name: Machine and I want to change text to PC: Machine
if i am not so clear in my question then plz ask me.
regards
I Love SQL
|
|
|
|
|
Blue_Boy wrote: if i am not so clear in my question then plz ask me.
I see a couple of statements but do not see a question. Is it encoded into the blank lines with the new algorithm by Pallab_GT[^]?
Best Wishes,
-David Delaune
|
|
|
|
|
thanks Randor,but that's not what I need.
I will try to explain again.
I click Star->Run and I write dxdiag command then i have DirectX Diagnostic Tool window, in this window i want to change text of original one, example : On System tab it's informations
Current Date/Time:
Computer Name:
Operating System:
Language:
.
.
.
and I want to change like this
Da/Time:
PC:
OS:
Language:
.
.
.
how can I do those changes?
regards
I Love SQL
modified on Sunday, April 13, 2008 3:58 AM
|
|
|
|
|
I'm not sure that your question has anything to do with the forum subject. Maybe you should have asked this somewhere else.
This seems to work. Hope your a C++ developer.
typedef struct _WINDOW_INFORMATION
{
TCHAR title[MAX_PATH];
TCHAR Wndclass[MAX_PATH];
} WINDOW_INFORMATION, *LPWINDOW_INFORMATION;
VOID ModifyDirectXDiag()
{
HWND hwnd = ::FindWindow(NULL,_T("DirectX Diagnostic Tool"));
if(NULL != hwnd)
{
WINDOW_INFORMATION wndInfo;
_tcscpy(wndInfo.title,_T("Current Date/Time:"));
_tcscpy(wndInfo.Wndclass,_T("Static"));
EnumChildWindows(hwnd,EnumWindowHandler,(LPARAM)&wndInfo);
}
else
{
MessageBox(NULL,_T("Cannot find DirectX window."),NULL,0);
}
}
static BOOL CALLBACK EnumWindowHandler(HWND hwnd, LPARAM lParam)
{
LPWINDOW_INFORMATION pParentInfo = reinterpret_cast<LPWINDOW_INFORMATION>(lParam);
WINDOW_INFORMATION childInfo;
if(0 != GetClassName(hwnd,childInfo.Wndclass,MAX_PATH))
{
if(0 == _tcscmp(childInfo.Wndclass,pParentInfo->Wndclass))
{
GetWindowText(hwnd,childInfo.title,MAX_PATH);
if(0 == _tcscmp(childInfo.title,pParentInfo->title))
{
SetWindowText(hwnd,_T("Hello World"));
}
}
}
return TRUE;
}
I can't believe I actually took the time to do this.
Best Wishes,
-David Delaune
|
|
|
|
|
thanks for your help, I'll try it
I Love T-SQL
|
|
|
|
|
There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened.
After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong.
Is it possible to change the maximum number of simultaneously opened files? If so, how?
21 cm: the universal wave length of hydrogen
modified on Saturday, April 12, 2008 2:39 PM
|
|
|
|
|
As I know of these limits are per process.
There is a KB article on this here[^], that may be of value. So your assumptions may be correct.
Also there are some obscure registry settings to change the limit on the max handle limit documented
here[^].
|
|
|
|
|
Hi Zoltan,
> There is a KB article on this here[^], that may be of value.
It reports 500 per process for NT 4. Seems to be the same for XP.
> Also there are some obscure registry settings
Those report 10000 handles. Weird. When Googling for an answer, [RedHat] Linux reports 1000 simultaneously opened files as maximum.
Fortunately 'decently' recoding the previous mess the solved my agony.
Thanks,
Henk
21 cm: the universal wave length of hydrogen
|
|
|
|
|
henk21cm wrote: Those report 10000 handles
Yeah but for handles you must count a lot of things like synchronization/event handles, registry key handles, thread handles, ui object handles (pens, brushes, etc) and file handles.
|
|
|
|
|
You can modify the maximum number of file handles opened simultaneously. I believe the ceiling is 2048 file handles. You can use _getmaxstdio[^] to verify this on your operating system. If you wish to modify this value you can use _setmaxstdio[^] to set the new value.
Best Wishes,
-David Delaune
|
|
|
|