windows

How does fast user switching affect a windows service?

How does fast user switching affect a windows service? Are the services suspended? or do they keep running in the background when a different user logs in? ...

Windows .BAT to move all directories matching mask from dir A to dir B

Hi - I want to write a .BAT file to move all sub-directories (whose name matches a mask) of C:\WINNT\Temp to H:\SOMEOTHERPLACE. So if my mask is ABC* then the directories : C:\WINNT\Temp\ABC1 C:\WINNT\Temp\ABC2 C:\WINNT\Temp\ABC3 should be moved to H:\SOMEOTHERPLACE and everything else (including files, as opposed to directories,...

Windows text editor that shows/hides lines based on RegEx or Grep syntax?

Hi, all. One of my application components produces some extremely hairy log files. They require a lot of poking and prodding before they produce useful information. I'm on the hunt for a text editor for windows that will let me enter text in either RegEx or Grep-style syntax, and automatically show/hide the relevant lines. Does anyon...

How to run a script on linux from a windows service?

Does anyone know an elegant way to initiate a bash script (to run on a linux box) from a windows service written in C#? I can only think of some combination of putty doing auto-login and automatically running a command upon login. But this seems clumsy and a bit insecure. Security doesn't need to be very high as both boxes reside on t...

Looking for program execution file location!

Hi all, I have a program running only by using right clicking. How can we find the location of the that source file? I believe im looking for .exe extension. The folder where i installed it don't have the .exe file on that program and many .dll files. is there a possibility that it was running by those .dll file? thanks in advance! ...

How to obtain RAID type?

Hello, I'm making a program which tells me information about the system hardware, but I don't know how to know if the system has a RAID or not, and if it has, its type. The program is written in Python, but I'm using a library which wrappers C# libraries, like Win32_Classes, so I can use any C# libraries. I've used a function called Win...

Why check only certain values for errors? (C++?)

I recently started learning DirectX/Windows, and the book I'm learning from had the code d3d = Direct3DCreate9(D3D_SDK_VERSION); if(d3d == NULL) //catch error &c. My question is: What would cause an error in this line, that is different than what would cause an error in another line (say, for example, int num = 42)? ...

Memory leak tool for C++ under Windows

I need a recommendation of a free tool (even for a trial) for detecting memory leaks in C++ under Windows (Visual Studio 2005). I've looked in the net, but I would prefer a recommendation. ...

Listing windows user accounts using C#

Hi, I have to list all users (both local system and domain). I tried using WQL but it takes a lot of time for the program to run. Is there any other way to get it from registry? Any help would be appreciated. ...

how to delete all files and folders in a folder by cmd call

Hi, i use windows. i want to delete all files and folders in a folder by system call. i may call like that: >rd /s /q c:\destination >md c:\destination do u know an easier way? ...

windows command line script variable going wrong somewhere?

Hi Battling with a windows command line script I just can't get to work. Basically I am trying to launch a program called vnctv.exe with the parameters of HOST ipaddress PORT 5900 PASSWORD x, however I only want to run the program with IP addresses of computers currently online. I've tried a few different things but I cant get anythi...

Running PHP with CURL to copying file to shared folder gives permission denied error

Hi All, I'm using Windows on my servers. I have to periodicly download some file to SERVER1 from FTP server. And then copy those files to shared folder on SERVER2 after downloading them. For this job, I write a PHP script and I scheduled it with CURL within .BAT file like: c:\curl\curl.exe http://localhost/getmyfiles.php My script ...

how to find "My Documents" folder

I'm willing to save a file in the user's "My Documents" folder. I tried getting the location like this : System.getenv("USERPROFILE")+"\\My Documents\\" then, I realised this wouldn't work in a system where the language is set to another language, french for example. is there another way of getting the "My Documents" folder efficien...

Problem running .bat file on Windows due to "input line is too long"

Hi, I'm using Windows and have a batch file (contents attached below) where I'm building up a classpath before trying to run a Java class. Unfortunately the classpath is fairly big and the file ends up being ~14kb. When I run it I'm getting an 'input line too long' error. I have read elsewhere that the max. size for an env variable i...

How to prevent access violation on unmanaged dll call?

We have inherited a legacy system for reading to and from meter guns. This system was originally build on XP with .Net 1.1 (VS2003?). Having recompiled it on VS2008 with .net 3.5 we get an access violation when calling the dll (dll not touched). The original program (using basically the same code) is running fine on our production machin...

How to turn off pc via windows API?

Hello all I never programmed a winapi so i have a little problem here . I need turn off my pc from my application . I found this example link text then i found this example how to change privileges link text But i have problem how to get that parameter HANDLE hToken // access token handle I think i need to make it in the next orde...

Windows socket WSACleanup C++

Hello, I am using sockets on my program. Due to I added the WSAStatup. My application runs fine (It is always up till it gets a signal to stop). After getting the signal it stops te problem that if I write the WSAClenup function at the end of my program it crashes and if I remove it it termintes fine. Thanks ...

Cursor becomes diagonal resize when form is above and left of the primary monitor

We have an application that runs on XP64 and Vista64 multiple monitor workstations, and have a strange problem when a single form in the application is moved to certain monitors. If the form is moved to a monitor that is to the left and above the primary monitor (it has negative coordinates in the Display Settings dialog), the users wil...

Win32 ,Multiple NIC computer , different DNS per NIC , how gethostbyname behaves ?

Hello SO, On a win32 multiple nic computer, how to force DNS resolving through gethostbyname() on a specific nic if all nics have different DNS configured and have the same metric ? Otherwise, how to know which DNS will be used to resolve names each time a gethostbyname() call will be performed by the application ? ...

Service Not Able to See Environment Variable

I created an installer (via WiX) that, as part of the installation, installs a Windows service (written in C#), and starts that Windows service. The service is a FileSystemWatcher and watches for the installation of plug-ins to a specific directory. Originally, it used an environment variable (which pointed to the path I wanted to watc...