Thursday, March 26, 2015

Safe to delete "C:WINDOWSSoftwareDistributionDownload"


One of our Windows 2003 servers has a fairly small C-partition, which is approaching full. I've had a quick look round using Disktective as to where the space has gone, and a fair bit of it seems to be taken up with C:\WINDOWS\SoftwareDistribution\Download


I think this folder is used as a temporary storage for Windows Update, but as all the pending Windows updates have now been installed, is it OK to delete the contents of this folder?


Answer



After you have installed all the pending updates, it is safe to delete all the files and folder under C:\WINDOWS\SoftwareDistribution\Download\


As @Zab said, stop the Update Service while you clean up the folder



  1. Enter net stop wuauserv into an elevated command prompt

  2. Manually clean up C:\WINDOWS\SoftwareDistribution\Download\

  3. Enter net start wuauserv into an elevated command prompt
    As soon as the service starts again, some folders will be re-created. This is ok


worksheet function - Excel - Overflow the text of a cell to an adjacent cell that contains a formula



I have a table filled with datas that comes from other tables. The formulas in the cells of my table are quite simple (reference to a cell in another worksheet).



Table example




In my table, I have "Title" rows (rows 57 and 64 in that case) that contains only one text value that I would like to overflow to adjacent cells since the adjacent cells in those rows will always be empty.



If the values in the table where entered manually, there would be no problem and the cell would looks like exactly like I want it as in the image below.



Table has it would be if data was entered manually and has I want it



The value of the first cell in row 57 does not overflow because the adjacent cell containt a formula (the formula is basically "=OtherCell" where OtherCell does not contain any value (more specifically, a value of ""))



It is important to note that the position of the "title" row changes and occurs in many rows in the table since the data are automatically extracted a database.




How can I achieve this...




  • Without using manual intervention (those are automated reports, I can't delete formulas because the next report generated will be erroneous)

  • VBA can be used, but not in a way that modify the table in an "irreversible" way (in a way that makes that the next time the sheet is calculated, the data is erroneous), for the same reason as manual intervention.



I use Excel 2013, but I believe this question applies to 2007+ versions of Excel.


Answer




The short answer is: You can't.



The long answer is that only truly empty cells will allow text from the next cell to the left to spill over and display in that cell.



This is just how Excel works.



If you specifically exclude manual intervention, deleting formulas, as well as VBA, there's really nothing left other than accepting the defaults, which is that a formula in a cell to the right will prevent text from spilling over to the right.



Don't shoot the messenger.


Unable to format RAW SD card?

The phone is suddenly switched off when I copying files to my Micro SD. After that my phone couldn't detect that SD. Then I insert it to pc using card reader. when I try to open SD drive on pc, the sd card suddenly unplugged. It's happening many times. then I tried to format it when it's detected. But it's getting much time and finally it says windows is unable to format. Please anyone tell me a way to format it.

windows 7 - How to remove rarely used languages from language switch hot keys?


I type in the following 3 languages:


Language A - 55% of the time


Language B - 40% of the time


Language C - 5% of the time


The usual solution would be to have all three languages installed and use Ctrl/Alt-Shift, however it is quite annoying to have to switch over Language C each time I swap back and forth between A and B.


Is there some sort of solution that would allow me to prevent Windows from switching over to language C when I press Ctrl/Alt-Shift? I could then add a separate hotkey for switching over to Language C.


I'm using Windows 7 SP1.


Thank you.


Answer



You can create Autoit script for "skip" Language "C" when switch keyboard language.


After install Autoit and Editor. Right click on desktop->New->Autoit Script. Right click on this created file->Edit. Now you should see ScITE window and after line "Add your code below here" add this code:


#include 
ClipPut(_WinAPI_GetKeyboardLayout(ControlGetHandle("[ACTIVE]","","")))

Press SHIFT+ALT(or which hotkeys registered for switch keyboard language) until your current language will be "C"(if keyboard language name not show up in taskbar press Win+R ->> CTFMON.EXE ->> Enter) then in the ScITE window press Tools->Go. Now in your clipboard Language "C" code. Paste(CTRL+V) and save it somewhere.


Remove previous code and paste this:



#include
#include
#include
#NoTrayIcon
$skiplang="0x04090409" ;skip this language when switch language
$list=_WinAPI_GetKeyboardLayoutList ( )
$fakeforwardlang=""
If IsArray($list) Then
if $list[0]<3 then Exit; you potato
For $i = 1 To $list[0]
if $list[$i]=$skiplang Then;find next lang
if $i=$list[0] then
$fakeforwardlang=$list[1]
ExitLoop
EndIf
$fakeforwardlang=$list[$i+1]
ExitLoop
EndIf
Next
Else
Exit
EndIf
$fakeforwardlang=StringMid($fakeforwardlang,1,6)
while 1
$handle=ControlGetHandle("[ACTIVE]","","")
if getcurkb($handle)=$skiplang then _WinAPI_SetKeyboardLayout($handle, $fakeforwardlang)
Sleep(100)
wend
Func getcurkb($handle)
Return _WinAPI_GetKeyboardLayout($handle)
EndFunc

For next step need replace saved language "C" code with 0x04090409 in this script(5 line).


Then in SciTE window press Tools->Build. Now you will get executable in same directory where was Autoit script. Run this executable(.exe).


Need use task manager for kill process if want stop script.


Works on Windows 7 with 3 keyboard language and disabled UAC.


Update:


I screw up. _WinAPI_SetKeyboardLayout Forward work only sometimes. Standard send very buggy when {down} key pressed. Current solution based on external function. But one issue with this function you need unpress shift and alt for switch to next keyboard language. Should recheck code later.


Update2:


Back to _WinAPI_SetKeyboardLayout but using fake forward. I can't find any issues now.


Windows 10 Reinstall Activation

I originally had Windows 8.1 Pro installed on a machine. This was upgraded to Windows 10 Pro a while ago.



Unfortunately last night my OS SSD died and I've just installed a new one and installed Windows 10.




According to this Microsoft Article I need no Product Key as Windows will automatically activate online.



I have linked the new Windows 10 installation to the same Microsoft account but I'm still unable to get Windows to activate.



I had written down the product key as shown to me by the previous Windows 10 installation but that starts with two 0s which you can't even type into the product key box as it reports as an invalid character.



Has anyone else gone through this process and successfully activated Windows 10?



I'm worried if the change in hardware is the issue ... surely this is a very common scenario for the need to reinstall Windows?

Wednesday, March 25, 2015

windows - How to run a process in the background without keeping a batch file open?


I have a Windows service (the Bamboo integration server) that runs a batch file as a subprocess (a build job) of that script. Within that batch file I would like to be able to start a process (let's call it workerprocess.exe) and have that process run in the background. This is all good, I've used:


start "title" /B workerprocess.exe

That is all well and good. The problem is that this then holds up the completion of the build job. So the batch script finishes, but because of the workerprocess.exe subprocess, the service (Bamboo) does not know that it has finished: it still waits for (and displays output from) the workerprocess.exe.


I've looked in the documentation for the start command, and I can't see anything that does what I want. I saw this question but it didn't really help either - the service still ends up waiting for the process to finish.


So I guess in summary: how can I run a new process from a batch script so that it is completely detached and won't hold up anything that happens to be waiting for that batch script to complete.


Answer



Have you tried Hidden Start (HSTART)? (Costs $20)


I use it personally to run an hourly batch job with the window hidden. They also mention that you can run commands sequentially as a parameter (or by default, I assume) run asynchronously. I don't know how this will affect your contention on CPU, memory, or disk... but the software also gives you the option to wait some time before performing the action.


performance - Are faster processors hotter?



Let's take the Intel Core 2 Duo P7350 and P8600 for an example. Both have a 3MB cache and a 1066MHz FSB, but the P7350 runs at 2.0GHz, while the 8600 runs at 2.4GHz. Is there a tradeoff between heat generation and performance?



Answer



Yes! All else being equal (that's key), a processor with a higher clock speed will use more energy and therefore also produce more waste heat.



Sometimes manufacturers can redesign a processor in a more-efficient way, or move to a different manufacturing process, or other factors can influence how much waste heat is generated such that faster processor could even use less energy. But, given the critical "all else equal" condition, a faster processor runs hotter and there is a tradeoff between speed and heat/energy use.



In fact, there's a growing market out there for processors that are intentionally underpowered to serve as cpus in computers that don't need great performance.


linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...