MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically.
darqious replied to darqious's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)Uhm... After struggling with it for the last 3 days it's a shame to tell, but... for testing purposes I had to give my batch file any name, and my first thought was... sc.cmd SC.freaking.cmd And I named it like that every time I tested it on XP. ...please don't. I'll die by myself. Problem solved. Thanks and regards.
darqious posted a topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)Hello, I have a problem running a batch file I'm creating for Windows XP. At some stage it has to check whether a service is running or not. Let's assume that I type in the following command directly into a command prompt: for /f "tokens=3" %H in ('sc query Spooler ^| findstr "STATE"') do echo %H It runs flawlessly and outputs 1 or 4, depending on a service state. The problem starts when I put this command in a batch file, suitably modified by doubling % signs: for /f "tokens=3" %%H in ('sc query Spooler ^| findstr "STATE"') do echo %%H or any other for /f loop where sc is a command to process - even sc alone in a loop. When processing the command, cmd.exe processes start to multiply indefinitely and the batch execution hangs. I've tried both XP HE and Pro, English and Polish variants. Also, there is no such problem under Windows 8. For what I've checked, this issue only applies to sc - any other command I've tried in a loop ran without a problem. This command alone: sc query Spooler ^| findstr "STATE" also runs without a hassle. Has anyone encountered such a behavior? Any ideas? Regards.
darqious replied to Agorima's topic in Windows 8Actually Vista and 7 requires an i686 (Intel Pentium Pro) or RISC86 (AMD K5, no PAE capabilities). Original Pentium/PMMX can run none of these OSes.