windows

How to create a PowerShell script to check if txt files have more than 1 row of text?

So I have alot of .txt files. I need for it to move txt files to a certain folder if they have more than 1 line. That is, Text text text Blah blah blah But leave it alone if it's just Text text text Any suggestions on how to do this? This is on Windows XP if that helps. Thanks! EDIT: Thanks John for your efforts. Figured out a w...

MAC address to IP Address on Same LAN in C#

Is there a way to find mapping between MAC address to IP address in C#. i think RARP should be able to do that, is there an API available in C# for that ...

How do I communicate from my global hook to my application?

I installed a global hook using win32 but I need to communicate with my main application. How should I do this? I guess the dll can have a function where I set my apps HWND and then the hook can sendmessage it? or should I search the window titles to find my application from the hook and sendmessage that way? What's the best strategy and...

windows - allowing remote desktop machine to access local files

Hi, currently i have two machines A and B... both are running WinXP. I am on machine A and using mstsc to connect to machine B. Now, how can i see from machine B the cdrom, usb, disk drives of machine A? even more if connect any usb to machine A can it be automatically detected by machine B also? ...

Does a cross-platfrom compiler that can compile a native executable that can be run both in linux windows exist? Could it exist?

I remember a few years ago(2002) there was a multipartite virus that could be run natively on linux and windows. I don't know if a compiler could be specially craft an executable so that it could be read as both ELF and PE, so that the os would start executing at different entry points. Or a program that could merge two programs, one com...

Suspicious value from WMI Win32_PerfRawData_PerfOS_PagingFile PercentUsage figure.

I've written a little VBScript program to query the page file usage under Windows XP (eventually 2003/2008 Server as well) but the figures I seem to be getting are bizarre. This is the program: Set wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") for i = 1 to 10 Set qry1 = wmi.ExecQuery ("Select * from Wi...

How to determine whether an LSA session is active in Windows XP

I'm trying to get the list of users currently logged into a machine. On Windows 7, I can call LsaEnumerateLogonSessions, then WTSQuerySessionInformation with WTSConnectState. But on XP, each LSA session has 0 for the TS Session field (unless it's a Remote Desktop session), which always has WTSConnectState of WTSActive, and I end up lis...

Any useful suggestions to figure out where memory is being free'd in a Win32 process?

An application I am working with is exhibiting the following behaviour: During a particular high-memory operation, the memory usage of the process under Task Manager (Mem Usage stat) reaches a peak of approximately 2.5GB (Note: A registry key has been set to allow this, as usually there is a maximum of 2GB for a process under 32-bit Wi...

is it possible to resize/hide Window Standard Dialog ("choose file to upload" window) ?

The "choose file to upload" window which pops up when the browse button is clicked in the file input element on a web page. Is it possible to hide/resize this "choose file to upload" window using user32 lib functions like ShowWindow etc. I tried using ShowWindow by providing the handle of the "choose file to upload" window but it didn'...

Windows running application list using Java

How to get Windows running application list using Java?I got to get the processlist. ...

Plugin DLLs that depend on other DLLs

I am writing a DLL to plug into another (3rd party) application. The DLL will need to depend on another set of DLLs (for license reasons I cannot link statically). I would like my DLL to be "xcopy-deployable" to any directory. I would also like not to require adding this directory to the path. If I just build the DLL the usual way, Win...

How to debug MPI application under Windows?

I have MPI program which I want to debug. I use mpich 2 under Windows, so does anybody know tools that can help me? Is it even possible? ...

How can I set the size of the cmd.exe window from my Perl program?

I have a Perl script running in windows, that displays to screen very long lines. I don't want to fix my console size permanently. I just want it to be big in case this script is running. Is there a way to define the console's size from within the Perl script that runs inside this window? ...

Why paint messages get lost even after calling UpdateWindow() ?

I have an application with following windows hierarchy: W1 -W2 (Child of W1) - W3 ( Child of W2) --------------------| | W1|------------| | | |W2 |------| | | | | |W3 | | | | | |------| | | | |------------| | |-------------------| When certain event happens in W2, I call UpdateWindow: W2::onCertainEvent()...

POVRAY for windows: using the command line to render several pov files

Hi All, I am trying to automate the rendering of several pov files so I made a simple script that runs all the pov (pvengine.exe...etc) in a for loop. However, this doesn't work since the GUI editor always comes up so that I have to manually close it down before the next one can start. By looking on this forum and google, there is appa...

Windows script to download and print a file ... suggestions?

I've need to get a file from a remote (embedded) system (which I can do either by wget or an ftp command) then print the contents of the file. Once I've retrieved and printed the file I don't want to do it again. It's a simple matter to make the embedded system publish a file that contains a number, or directory listing which the ho...

What is RIDI_PREPARSEDDATA in GetRawInputDeviceInfo?

Windows API function GetRawInputDeviceInfo has a parameter uiCommand. One of the options is RIDI_PREPARSEDDATA. It says "pData points to the previously parsed data". I don't get what previously parsed data they are referring to. Is it the data that was last sent with WM_INPUT? Or is it data that was returned by any of the functions? Or ...

Win32API: How to determine if EN_CHANGE was because of user action, not software action?

I find this situation comes up from time to time, and I never seem to have a really robust generic solution to it. I have a control - in this example an EDIT control on a dialog. I want to take certain actions in response to the user - and only the user - modifying the contents of the edit control. The edit control can be set programm...

Can't authenticate with different NTLM credentials in one session with java.net.URLConnection

When I access a HTTP server using the standard Java API (java.net.URLConnection), the credentials are "cached" after the first successful authentication, and subsequent calls to Authenticator.setDefault() have no effect. So, I need to restart the application in order to use different credentials. I don't observe this effect when Basic A...

Detect 64bit OS (windows) in Python

Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files. Many thanks ...