|
Hi I want to monitor a "DIRECTORY" if any log file is writing to it: "Error : xxx" - if located, a specified Exe can be triggered to execute.
Anyone suggest a tool with which this objective can be accomplished?
I also tried to accomplish the same by:
<br />
for /f "eol=; tokens=*" %%x in (C:\temp\*.log) do if "%%x" CONTAINS "error" LogMonAction.exe<br />
Basically I tried to monitor all log files in C:\temp directory, if any log file created/updated since last night, execute "LogMonAction.exe" or another log file.
Problem with above script is, there's no such comparison operator "CONTAINS", and you cant do this on a DIRECTORY. And let aside the additional requirement - only files updated/created since last night.
Reference:
(a) If statement: http://www.robvanderwoude.com/if.html
(b) Textlog Monitor: http://www.sharewareconnection.com/text-log-monitor.htm
|
|
|
|
|
|
Hey know how to do this? It's a MS DOS batch file, I'm having trouble computing "Yesterday" and xcopy /D date command - I want all files updated since yesterday.
<br />
SET YESTERDAY= %DATE% -1 ----- how do I compute *yesterday*?<br />
SET USERNAME=someguy<br />
xcopy %LOGFILEDIR% %SHAREDIR%\%YESTERDAY%\%USERNAME% /e /I /C /K /D:%YESTERDAY%<br />
Bolded part is where the problem is ... Also /D switch takes the following format:
<br />
/D:8-29-2007
Reference: xcopy
|
|
|
|
|
Wow that is long as you said I found this our "examples" on our dev server at work and I don't remember where it is from...
for /f "tokens=2" %%g in ('date /t') do set datesplit=%%g
set mm=%datesplit:~0,2%
set dd=%datesplit:~3,2%
set yyyy=%datesplit:~6,4%
echo %mm%
echo %dd%
echo %yyyy%
set /A dd=%dd% - 1
set /A mm=%mm% + 0
if /I %dd% GTR 0 goto FINISH
set /A mm=%mm% - 1
if /I %mm% GTR 0 goto ADJUST
set /A mm=12
set /A yyyy=%yyyy% - 1
:ADJUST
if %mm%==1 goto SET31
if %mm%==2 goto LEAPCHK
if %mm%==3 goto SET31
if %mm%==4 goto SET30
if %mm%==5 goto SET31
if %mm%==6 goto SET30
if %mm%==7 goto SET31
if %mm%==8 goto SET31
if %mm%==9 goto SET30
if %mm%==10 goto SET31
if %mm%==11 goto SET30
if %mm%==12 goto SET31
goto ERROR
:SET31
set /A dd=31 + %dd%
goto FINISH
:SET30
set /A dd=30 + %dd%
goto FINISH
:LEAPCHK
set /A tt=%yyyy% %% 4
if not %tt%==0 goto SET28
set /A tt=%yyyy% %% 100
if not %tt%==0 goto SET29
set /A tt=%yyyy% %% 400
if %tt%==0 goto SET29
:SET28
set /A dd=28 + %dd%
goto FINISH
:SET29
set /A dd=29 + %dd%
:FINISH
if /i %dd% LSS 10 set dd=0%dd%
if /I %mm% LSS 10 set mm=0%mm%
rem here you can format how you like, from above it should be
set YESTERDAY=%mm%-%dd%-%yyyy%
echo %YESTERDAY%
|
|
|
|
|
Thanks! You saved my life!
|
|
|
|
|
How about a quick .VBS file? That would be pretty more simpler. Isn't it?
|
|
|
|
|
from my co worker
any suggestions?
Its on win2k server
bryce
=======
Hi,
Is anyone a DOS scripting expert? We need help with the script below. The kill processes at the bottom are hanging if the process does not exist. Does anyone know of a way of only killing the process if it exists? Any sort of help with error checking would be useful too.
Thanks,
===========
@echo ~~~~~ Start StopWeb.Bat ~~~~~
@echo --------------------------------
@echo Shutdown normally
@echo --------------------------------
net stop rcom
net stop "GeoMedia WebMap"
net stop "FTP Publishing Service"
net stop "Simple Mail Transport Protocol (SMTP)"
net stop "Network News Transport Protocol (NNTP)"
net stop "World Wide Web Publishing Service"
net stop "IIS Admin Service"
@echo -------------------------------------
@echo Kill processes that did not shut down
@echo -------------------------------------
kill -f rcom.exe
kill -f gwmadmin
kill -f gdccachedwareho*
kill -f mapsvr.exe
kill -f mapsvrmngr.exe
kill -f inetinfo.exe
@echo ~~~~~ End StopWeb.Bat ~~~~~
|
|
|
|
|
You need to use tasklist along with a filter to find out if the task exists. If it does, you can kill it.
This discussion on a very similar topic[^] may be helpful in solving your problem.
Cheers,
Sebastian
--
"If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
|
|
|
|
|
net stop iisadmin /y is a better solution, if it's supported on Windows 2000. It stops the IIS Admin Service and all the other services which depend on it. I've never had to kill the inetinfo process.
We do use net stop in a shutdown batchfile on our DC/Exchange server as, when Exchange is installed on the DC, the Exchange service and Active Directory seem to get into a deadly embrace and Windows takes half an hour to shut down.
Perhaps try PsKill[^] rather than kill ?
(Small pet peeve: it's not DOS. cmd.exe is a native 32- or 64-bit Windows console application. So for that matter are net.exe and kill.exe. Regular Windows applications can create consoles if they want to, and console applications can be run without a visible console if the appropriate flags are passed to CreateProcess . Windows x64 has no DOS compatibility as the required processor sub-mode is not present in 64-bit mode and Microsoft didn't consider it worthwhile to write an emulator. Even some Windows command-line utilities with a .com file extension are actually Windows console-mode EXEs.)
|
|
|
|
|
Hi all,
Can u give me the link of multiple Skype .
Thanks all of You for this .
nilesh
|
|
|
|
|
|
http://www.live.com/[^]
"We are all repositories for genetically-encoded information that we're all spreading back and forth amongst each other, all the time. We're just lousy with information."
- Neal Stephenson
|
|
|
|
|
Hi All
When I run a program I resived this error
%Application Name%
The instructiion at "0x7c883f9c" referenced memory at "0x7c883f9c". the memory could not be "Written"
Click on OK to terminate the program
Click on CANCEL to debug the program
|
|
|
|
|
How awful for you.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
Well, with the information you haven't provided, there could be any one of about 1,000,000 causes.
That error message is about as generic as it gets.
|
|
|
|
|
A memory access violation has occured at 0x4A657272792048616D6D6F6E64
"We are all repositories for genetically-encoded information that we're all spreading back and forth amongst each other, all the time. We're just lousy with information."
- Neal Stephenson
|
|
|
|
|
|
On my copy of Windows XP, that address falls into the address range that kernel32.dll is loaded at. It doesn't appear to be associated with any public symbol (i.e. functions whose names Microsoft are willing to disclose).
It would be unusual to have self-modifying code in this part of Windows, and it's very rare for an instruction to modify itself. I suspect that either the program has become corrupted or that your system memory is bad. To test the memory, use Windows Memory Diagnostic[^] or memtest86. If it appears to be bad, check that you're not overclocking any components of the computer, check that the fans are working and that they're not clogged with dust (also check the heatsinks for this) and ensure that nothing is overheating.
|
|
|
|
|
It is Bad Memory Error. Which program is causing this?
A Google Search of that code brought me results from diversified programs like McAfee, LogiTech etc. Possibly a corrupt installation?
|
|
|
|
|
Hi everyone,
Is it possible to install two different windows on the same drive for example drive c of course I know its not recommend but I want to know if I install they on the drive can I use of them without any problem because they have a name WINDOWS on the root for their.
|
|
|
|
|
Yes, it is possible to install two copies of windows on the same C:\ drive, the second install will want its own seperate %WINDIR%, something like C:\Windows2\ maybe. Sometimes when you try to install two copies it will go wrong. Therefore you might want to try it a few times on some other computer before you try it on our main one (whith its stuff backed up).
Im not sure exactly if this is the answer you want though...
//Johannes
|
|
|
|
|
Even when dual boot is confusing, this would make more things haywire right? Virtual PC should clean all such troubles.
|
|
|
|
|
If the version(s) of Windows you're intending to use are NT based, NT, Win2000, XP, Vista then I'd consider putting each copy on it's own partition. That should work no problem and give you a boot menu to choose which one to boot from. Always install the older version first if they're not the same. The newer one will recognise the older one and fix the boot menu for you.
If the version(s) of Windows are 98, 95 or even earlier then side by side on a single partition is fine. If you were considering installing Windows ME DON'T!
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I don't think recent versions of Windows will even let you do that. The two OSes would write over each other's DACLs and directories (like Program Files and Docs and Settings)
|
|
|
|
|
Surely you can on Win XP (using two different names of C:\Windows folder).
But I got in past some problems with C:/Document and settings and C:/Program Files because the two version was trying to write in the same place!
Strange things can happens if you install the same program (like Winzip) in both version on Win and disinstall it only one time ... the second version of windows will not find the program on C:\Program Files/Winzip
Russell
|
|
|
|