Thursday, November 2, 2017

batch - BAT: opening X amount of programs/files maximized but also minimized


I currently have this piece of BAT code that opens all files in a folder maximized.


for %%i in (C:\Users\Programs\*) do start /max %%i && timeout /t 10

What I want to achieve, is for the code to also minimize all the programs after it has opened them in a maximized state. Is this possible in some way?


Answer



Perhaps adding this line next will help:


powershell -command "(New-Object -ComObject Shell.Application).MinimizeAll()"

It will minimize all windows (not just the ones you launched or are maximized).


windows 7 - How can I easily split a CSV into two Excel worksheets with PowerShell?

I recently found out that PowerShell can be used to write Excel documents. The first use I thought of for this was to (at least partially) automate parsing of some CSV reports that I regularly have to work with.



The basic job I need to do goes something like this:




  1. Create an Excel workbook with two worksheets.


  2. Copy the column headers from the CSV file to Row 1 on both sheets.

  3. For each row in the CSV that meets a certain condition (e.g.: value in column R equals "Don't put in Sheet 1") append the row to Excel worksheet 2.

  4. Each row in the CSV that is not destined for Excel worksheet 2 should be appended to Excel worksheet 1.



Step 1 is simple enough - I've found several guides online to help me get started there. I'm also confident I can handle the conditional logic required for steps 3 & 4 on my own, based on past PowerShell experience. The problem I'm having a hard time finding a solution for is writing all the data into the sheets.



I haven't actually written any Excel-generating PowerShell scripts just yet, but every guide that I've seen only seems to include instructions for writing individual cells - not entire rows at once. Is there an easier way to do this?



Some things I'd be interested in, if they exist:





  • Some means of copying an entire row from a CSV file to an Excel worksheet without having to loop through individual cells in the row.

  • Some way of copying an entire row from one CSV file to another without having to loop through individual cells, plus a command (or reasonably short script) to import a whole CSV file into an Excel Worksheet.

  • Last resort: A for loop (or similarly short script block) to be used in place of a write-entire-row method. This should be able to determine where to stop copying cells in a row without having to go all the way to the last column (I think it's XFD these days), while gracefully handling empty cells in the middle of a row.



Aside from figuring out the above, the real hard part of my script is going to be making sure it can work efficiently on source CSV files that may be thousands (possibly tens of thousands) of rows long.



The final script will need to be compatible with Windows 7, PowerShell 2.0, and Excel 2010.

How to dual boot Windows 8.1 and Ubuntu 13.04 with Windows Metro Boot Loader

I'm having a laptop with 4 Partitions,



[1] 350 MB Windows System Reserverd
[2] 40 GB for Windows Installation
[3] 25 GB for Ubuntu Installation

[4] 400 GB for Data Storage



I have installed Windows 8.1 on my BIOS (non UEFI) based laptop on Partition [2] and booted successfully.



Then I put the fast boot off and installed Ubuntu 13.04 on Partition [3] using Live USB Key and on reboot GRUB Screen Appeared with the options to boot into either Ubuntu or Windows and both are working perfectly.



Now the issue is, I do not like the GRUB Interface and want to replace it with Windows 8.1 Metro Boot Loader. Can anyone help me replacing it with the same ?



Kind Regards

Wednesday, November 1, 2017

Keyboard selective ghosting


I've been experiencing a problem with my keyboards lately.
I own an Alienware laptop M11x. I've attached a USB Trust keyboard first and experienced some problems while playing FIFA 12. Namely: When the Left and Up buttons are pressed I cannot press one of the buttons S, G, B, N, H. S is very important since it's my pass button.


So I took the keyboard back and bought a Microsoft Keyboard 600. Alas, the problem still persists. I must say that for instance I can press 4 buttons like: A S D F and it will work like a charm.


Update: I must say that that particular problematic combination works on my laptop keyboard and it persists over the whole system.


Cheers


Answer



It's call n-key rollover. It controls the total number of keys that can be pressed at one time on a keyboard before the controller stops recording new keypresses.


Usually, you'll only find full n-key rollover on high end keyboards. Normal or low-end keyboards will generally have a limit after which the keyboard controller will stop recording. As your key sequence is 8 keys long, you're probably well over the limit.


Wikipedia has an article with a few more details:
http://en.wikipedia.org/wiki/Rollover_%28key%29#n-key_rollover


If you really, really need a key combination this long for your kick move you'll need to try a keyboard that specifies full n-key rollover as a feature to ensure that the keyboard will always be able to handle every key you press all the time.


Windows 8 64bit say low memory while 4+Gb free

I have windows 8.1 64 bit, 8Gb ram.


My Task Manager shows 49% used ram, but I still get messages like "Windows is low memory, we recomend to close application". It always says that about the application which is not currently active, but uses more memory than other processes (when Firefox is up, it is Firefox, otherwise it's Skype).


So my question is: how to setup threshold or how to force Windows not report about low memory?


Note: even when it has 70+% free it still reports about low memory. Number of application running doesn't metter.


Note 2: it doesn't happen when I start new app. Looks like windows have some memory checker and it pops up that message on regular basis when swap off. It minimizes active apps(games or browser) and show me that weird message.

will re-installing windows without formatting and running anti virus remove viruses?

I suspected I had virus in my system. I downloaded the trial version of Kaspersky internet Security 2013, updated the DB and ran a full system scan. It identified the viruses and removed them and subsequent scans showed the system clean.


Just to be sure, I formatted the windows drive and reinstalled windows. I have some files that need to be backed up in the other drives and i cannot format them.


Will the reinstallation disable any lingering viruses or should I format the whole hard disk to get rid of the viruses completely?

smart - Are my hard drives dying?

Yesterday I came home from work to notice that not only had my PC reboot, it was stuck in the BIOS detecting hard drives. I eventually got the machine to boot but once I got into Windows it locked up. When I was able to get back into Windows (Win XP SP3) I noticed an error in the system event log: "The driver detected a controller error on \Device\Harddisk1\D" with Event ID: 11. I installed the SpeedFan utility and was able to capture the SMART information for both of my drives:


Hard Drive 0:


SpeedFan SMART


Hard Drive 1:


SpeedFan SMART


I don't know exactly how to interpret this data, but despite all the "OK"s I'm not entirely convinced that everything is ok. It seems like some of the values are beyond the thresholds which would indicate not ok.


Oddly enough, at this point the machine seems to be pretty stable. Any insight would be appreciated.


Edit: I appreciate everyone's concern, but I already have all my data backed up. At this point I'm just trying to repair the machine, data loss isn't a concern.

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...