Thursday, November 30, 2017

powershell - Robocopy replace same date file move



I'm using robocopy to move data. I want to achieve this



IF Source File data (Newer or Same) move/overwrite data

Else skip file



I need a switch or a way to just excluded newer not newer or same data. I'm using Robocopy to clean and move a lot of data to a big storage device.



A line to delete files from the source with matching date with target would be useful too



/XO excluded files Same date or Newer files in the target
/XN excluded files older in the source and newer in the target



Some of the data are already on that source.




My issue that I want to just excluded older not same date. I want to make sure to move (and overwrite so source get clean) the data with new or same data as the source.



I'm using /XO switch



/XO : eXclude Older - if destination file exists and is the same date or newer than the source - don’t bother to overwrite it.



The issue is I also want to move the same date data not just the newer.
Is there a way to do that?


Answer





Robocopy replace same date file move



IF Source File data (Newer or Same) move/overwrite data Else skip file




To complete this use Robocopy with the example batch script I provided below sytax and all.




I want to just excluded older not same date. I want to make sure to

move (and overwrite so source get clean) the data with new or same
data as the source.



The issue is I also want to move the same date data not just the
newer.




Since by default Robocopy will only copy a file if the source and destination have different time stamps or different file sizes, you have to use the /IS switch for it to also copy the same data over too, and then if you use the /MOVE switch, it'll also remove those files and folders from the source.







Robocopy Options Used



(I used these switches in particular but you should test to confirm all works as expected just in case.)



/S         : Copy Subfolders, but not empty ones.
/NP : No Progress - don’t display % copied. (for cleaner log file)
/R:n : Number of Retries on failed copies - default is 1 million.
/MOVE : Move files and dirs (delete from source after copying).
/IS : Include Same, overwrite files even if they are already the same.

/TS : Include Source file Time Stamps in the output. (for log file)
/FP : Include Full Pathname of files in the output. (for log file)
/LOG+:file : Output status to LOG file (append to existing log).


For the below variables of:




  • SET SRCRoot="\\Server\Share\Source"

  • SET DESTRoot="\\Server\Share\Destination"




The SET SRCRoot and SET DESTRoot are the root\parent directories you'll be copying to and from at the topmost level all the way down recursively. You can set either one of these to a drive letter path (e.g. C:\Path) or you can keep as UNC path (i.e. \\server\share\folder) and it'll work either way.




  • SET LOG=C:Path\Log.txt



The SET LOG is your appended log file name and location. It can also point to a drive full path or a UNC path. This is the file you can review to get all the detail of what copied, what did not, error messages, etc. This is strictly optional but I'd suggest using it always and review as-needed for troubleshooting or confirmation.




Robocopy Batch Script Example



If you need to also copy over the file level security of the files and folder you copy to source from destination (the ACLs), please let me know as you'll probably want to include the /SEC or /COPYALL swithces.



@ECHO ON
SET SRCRoot="\\Server\Share\Source"
SET DESTRoot="\\Server\Share\Destination"
SET LOG=C:Path\Log.txt

:: --// Robocopy Options

:::: --// If you do not want a log file, remove the "/LOG+:%LOG%" below
SET OPT=/MOVE /IS /S /NP /R:5 /LOG+:%Log% /TS /FP
SET CMD=Robocopy "%SRCRoot%" "%DESTRoot%" *.* %OPT%
%CMD%
EXIT /B





Optional Robocoy Switches




(If you need any of these, let me know and I'll be glad to update my answer if you need an example including any)



/E       : Copy Subfolders, including Empty Subfolders.
/SEC : Copy files with SECurity (equivalent to /COPY:DATS).
/DCOPY:T : Copy Directory Timestamps.
/COPYALL : Copy ALL file info (equivalent to /COPY:DATSOU)






Scheduling for Unattended Automation



Refer to my answer Scheduled Tasks for the options, gotchas, etc. you'll want to select when scheduling a batch script with Task Scheduler to run as expected. Screen shots and all are provided and feel free to upvote that answer if you find it useful and worthy as such—no pressure just an additional resource you may find useful.






Further Resources and Reading





command line - Completely disable UAC in Windows 10


When I was running Windows 7 Ultimate 32-bit, I had UAC disabled and everything was working smoothly for me. Now I've updated to Windows 10 Pro 32-bit (and recently also the 2015-11 update), I'm having a few issues. Although I have UAC set to "Never notify" in Control Panel, I find that certain activities are still fettered by UAC. For example, Windows Explorer doesn't let me create a file in certain folders, such as C:.


I use the Command Prompt quite a lot. In Windows 7, with UAC turned to "Never notify", Command Prompt automatically started as Administrator; whereas under Windows 10 I have to explicitly right-click and choose "Run as Administrator". More annoyingly, when I connect to the Windows 10 machine from another PC, using NET USE with my username for the target machine, I don't have access to do anything in folders that need admin access. I haven't found a workaround for this.


Is there a way to completely turn off UAC in Windows 10, so that I can do all admin tasks easily?


Answer



I found the answer myself.


WARNING: This is not generally recommended as it compromises system security. Only do this if you know what you are doing.


Using the Control Panel UAC setting only does half the job. To turn off UAC completely, go to


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

and change the value EnableLUA to 0.


Do what you need to do, and then set it back to 1 to avoid endangering system security for too long.


windows 7 - New mechanical keyboard not working

I've got a new "Kingston KyperX Allow FPS" keyboard, and I have plugged it in, but it's not working


OS: Win7, sp1.



  • Media keys work (volume up/down etc)

  • changing LED modes work

  • caps / num lock doesn't work

  • all other typing does not work.


If I plug another keyboard in at the same time (this second keyboard works fine), and if I press capslock on this keyboard the capslock light turns on on the kingston keyboard.


Any ideas? Anyone had anything similar? or is it just busted...


Thanks


EDIT: Keyboard works in BIOS, but not in windows.

How can I download windows latest version ISO file by using CentOS

The Microsoft provides a media download tool exe file that only download windows or its ISO file on windows machine. I tried and after downloading 4.x GB at the end its throwing error. I tried many fixes from google but having problem and not able to download on windows system.


I want to download it on my CentOS 6x dedicated server and then this ISO file to my computer. I googled a lot but not found any valid help. There are some websites that providing iso file but don't trust them


Best regards

Windows 7: What is the event ID for a lock event and how to tell if it is user-initiated or not?

The following eventvwr.exe event relates to a screen unlock event:


Event ID 4624 (access type: 7) (screen unlock)


Now I need to find the screen lock event, so I can compare the time between when I left the apartment and when the screen locked. If the difference is more than what is set as the screen lock time in the control panel, I will know someone logged on while I was away. Thanks.


NOTE:


I'm confused because this post tells another story.

macos - To set PATH on OS X when export PATH= don't work


I can't do 'export PATH=' When I try that only .swp files is created (.bash_profile.swp and .bashrc.swp). I'm on OS X 10.6.


$ echo $PATH


/Users/masterpriindustriellledning/perl5/perlbrew/bin:/Users/masterpriindustriellledning/perl5/perlbrew/perls/perl-5.14.2/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/X11/bin:/Users/masterpriindustriellledning/.rvm/bin

My .bash_profile , (When installed latest perl this corrected previous errors that .bashrc did not load. It had not done so since I created a .emacs I think)



PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
source /Users/masterpriindustriellledning/perl5/perlbrew/etc/bashrc
# Added by install_latest_perl_osx.pl
[ -r /Users/masterpriindustriellledning/.bashrc ] && source /Users/masterpriindustriellledning/.bashrc

My .profile


export PATH="/usr/local/bin:$PATH:/usr/local/sbin"

'brew doctor' gives some warnings. Never used brew since my brew does not work.


$ brew doctor



1. Warning: Unbrewed dylibs were found in /usr/local/lib.
2. Warning: Unbrewed static libraries were found in /usr/local/lib.
3. Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. ... Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.
4. Warning: Your Xcode is configured with an invalid path. ... *(brews suggested fix is not working for me)

My tries so far is.


$ grep export .??* , i.e. the things I tried to export to $PATH.


.bash_history:export GRAILS_HOME=/usr/share/java/grails
.bash_history:export PATH=$GRAILS_HOME/bin:$PATH
.profile:export PATH="/usr/local/bin:$PATH:/usr/local/sbin"

$ grep PATH .??*


.bash_history:which PATH
.bash_history:PATH
.bash_history:$PATH
.bash_history:echo $PATH
.bash_history:PATH=$GRAILS_HOME/bin:$PATH
.bash_history:export PATH=$GRAILS_HOME/bin:$PATH
.bash_history:echo $PATH
.bash_history:echo $PATH
.bash_history:whereis $PATH
.bash_history:which $PATH
.bashrc:PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
Binary file .bashrc.swp matches
.profile:export PATH="/usr/local/bin:$PATH:/usr/local/sbin"
.zshrc:PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

Answer



My quick fix. If I have. An empty .bashrc (when I put something there it breaks) , the line PATH="/usr/local/bin:$PATH:/usr/local/sbin" in both .profile and .bash_profile. As Daniel for pointing out terminal does not load .profile if .bash_profile exist.


power supply - Do voltage params of a laptop AC adapter and battery treated differently?


I'm considering buying replacement for my laptop AC adapter and battery. I've gone through a number of related discussion in internet, and got somewhat confused that a battery voltage may vary but AC adapter voltage must be strictly the same.


Also this answer states that laptop battery voltage can decrease over time. In the meantime many resources states, that electronic components can go harmed either with too low voltage and too high.


Does it mean, that battery is supplying power somewhat differently? Otherwise the answers appear to contradict each other.


Answer



Don't ever replace your battery or the power supply with one that it is not made for it--this is a very bad idea for a variety of reasons.


Basics on all batteries -
Battery voltage **rating **definitely should not change, be very steady, and match the original +- 2-3%. This opinion differs greatly from this post, however my opinion is just based on not knowing the specifics of that laptop's circuitry: "Laptop battery: is voltage really important to respect?" The number of amps that battery will deliver at that same voltage must also be sufficient, which is called power or wattage, (Amps x Volts = Watts). However, the amount of power you use with heavy use will deplete the battery much faster, and that battery capacity is rated in Amp/Hours. A/H capacity is reduced each time your discharge / charge that battery. Laptop batteries will generally only hold less than ~50% of their new capacity after 100 full cycles.


Laptop batteries -
Make SURE it is approved for YOUR laptop. There's a computer inside that laptop's battery, and it not only controls the health and charging of batteries inside, it also communicates with your PC. Most don't, but OEMs could prevent any non-OEM approved battery from even functioning. The amount of charge, and the rate of charge, is also regulated in most cases, by your laptop. Remember, that brick power supply also must feed the laptop itself, without the battery in most cases. (Don't run a laptop without a working battery, which acts to protect it from power surges better than any surge protector could.) OEM batteries that will operate perfectly, replacing the originals are extremely cheap and work great, if obtained from a reputable source. These have generally had the cells replaced with fresh ones, using the same circuitry. So, look on Amazon for your laptop's specific make and model, and read the reviews for potential problems. Also keep in mind that some Amazon vendors will sell "identical make and model" to what you are seeing, and they are not the same at all--YMMV.


Power supplies -
Extra or replacement power supplies are also extremely cheap these days. It is best to buy at least one extra, in case your original dies, which they do occasionally. Plus, if you commute, why carry, plug and unplug that brick a few times a day. Best is to keep a separate one ready, wherever you regularly use any laptop. They will work great, provided you get one your laptop recognizes as OEM for that laptop, voltage is the same, and the amps it will deliver is the same, or greater. If the laptop doesn't recognize the proper power supply, even with the correct voltage and greater amperage, it might run the laptop, but won't allow it to charge. Often, there's an extra wire to provide the battery-to-laptop communication link.


Role of internal support circuitry and software -
Additional circuitry inside laptops could make or break the requirement for tight voltage requirements, or any requirements. For instance, you want 120vAC? Then, take a few 12vDC batteries, add some circuitry, and wallah, you've got your 120vAC. the other significant role of the software is to ensure that whatever you are plugging into it, will work properly, or it could disable it completely if either not compatible or it was malfunctioning.


Laptops could be designed to take any battery, which however, would add to the cost, complexity, and unintended consequences. Even now, many OEMs, by design, still charge the batteries to 100%, showing both longer run times, but unnecessarily, MUCH shorter lifespans for lithium battery packs. Same problem for most all of our our cell phones, which are designed for the best advertised run time, not battery life.


Safety -
If you don't have the right expertise in electronics, computer hardware, and battery systems, you stand a good chance of destroying your laptop, if you modify any of these. Worse, with the wrong modifications, you could literally blow up your battery, or at least catch it on fire. Most battery repair shops open to the walk-in public will never even try to replace faulty cells in a lithium battery pack. It is just too dangerous to do correctly, unless you know that specific battery pack. Check out the Youtube videos of lithium battery fires should convince you.


Wednesday, November 29, 2017

windows - How can I add git.exe to Visual Studios command line path?

I've just set up a new computer. When I installed Visual Studio I didn't install Git because I don't want to use it from within VS. Instead I installed Git for Windows. However, a script we use to build the project uses git, and it runs the MSVC command line, so as it turns out, I need the VS command line's PATH variable to contain the folder where git.exe is located.



'git' is not recognized as an internal or external command, operable
program or batch file.



I've tried uninstalling Git for Windows and starting the VS installer again, hitting Modify and then adding Git and Github, but that didn't help.


Here's a similar question but the answer is to set the path from the command line, something I don't want to do. Adding an environment path to the Visual studio command prompt


Update Hmm, actually I'm not sure if it's the VC command line. Is there a way to find out? Because %PATH% contains the git folder on BOTH the "normal" Windows command line AND with the one in MSVC tools (though there are more than one). But not when I'm running our build tool, for some reason. It's more like VS cmd's path than Windows's but it lacks the git path.

windows - Initialize a not working disk


I have a 1TB 2.5" HDD causing me some trouble. I am using an external case connected to my computer through USB3. The case and the cable are working. I tried them with another working HDD.


On the disk management tool, I can see my problematic disk (Disk 2):


disk management tool


If I try to initialize it using a MBR partition, then a GPT one. In both case, I get the following error:


The request could not be performed because of an I/O device error.

enter image description here


On the device manager I tried to update the driver, but the best drivers for your device are already installed.


enter image description here


I also searched for updated drivers on Windows Update without success. Beside, uninstalling the device did not help.


Disk 2 does not have an assigned letter, so afaik, I cant use chkdsk X: /r.


Lets see if DISKPART can help. Running LIST DISK prompt:


DISKPART> LIST DISK
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 476 GB 1024 KB *
Disk 1 No Media 0 B 0 B

Disk 0 is my main disk. We have Disk 1 from the Disk Management tool. Disk 2 is not here. At that point, maybe we should dig into what is Disk 1. Is there a link between Disk 1 and Disk 2? Does fixing Disk 1 will solve the problem?


Selecting Disk 1 and creating a primary partition there will prompt this:


No usable free extent could be found. It may be that there is insufficient
free space to create a partition at the specified size and offset. Specify
different size and offset values or don't specify either to create the
maximum sized partition. It may be that the disk is partitioned using the MBR disk
partitioning format and the disk contains either 4 primary partitions, (no
more partitions may be created), or 3 primary partitions and one extended
partition, (only logical drives may be created).

It seems legit because DISKPART already show that DISK 1 has 0B free. Alright.


Most search I made online went to website promoting their own solution like aomei, partition wizard or minitool. I would like to use windows directly or to rely on a FOSS solution.


Feel free to ask more precision or information in comment, I will update this post to add them.


Answer



Lets try CrystalDiskInfo as recommended by @bertieb on the SU chat:


enter image description here


According to the Wikipedia's SMART page:



Count of "unstable" sectors (waiting to be remapped, because of unrecoverable read errors). If an unstable sector is subsequently read successfully, the sector is remapped and this value is decreased. Read errors on a sector will not remap the sector immediately (since the correct value cannot be read and so the value to remap is not known, and also it might become readable later); instead, the drive firmware remembers that the sector needs to be remapped, and will remap it the next time it's written.[57]


However, some drives will not immediately remap such sectors when written; instead the drive will first attempt to write to the problem sector and if the write operation is successful then the sector will be marked good (in this case, the "Reallocation Event Count" (0xC4) will not be increased). This is a serious shortcoming, for if such a drive contains marginal sectors that consistently fail only after some time has passed following a successful write operation, then the drive will never remap these problem sectors.



At that point, I dont want to rely on a problematic disk. One 1TB HDD is quite cheap nowadays. I will follow @DanielB's advice and ditch the old one and buy another.


windows 7 - Canon multipass c555 printer driver

I have windows 7 in my laptop, i want to use canon multipass c555 printer but there is no driver available to use. while i used driver for mentioned win xp which is not working in win7 . please help how to install my printer in win7 , is any software available

Adding Octave 4 (CLI) to system path variable (Windows 10)


I installed Octave 4 (from here) which has both a GUI and a CLI.
However, Octave doesn't seem to be added to the PATH variable, so typing octave or octave-cli into the command line doesn't do anything.
Is there a way to fix that (without adding all the other executables in Octave's bin directory to PATH as well)?


I use Windows 10.


Answer



How do I add Octave (CLI) to system path variable (Windows 10)?



Is there a way to fix that (without adding all the other executables in Octave's bin directory to PATH as well).



You don't add .exe files to the PATH, you add directories.


So you should add C:\Program Files\Octave\bin (or whatever your installation is) to PATH.


See How do I set system environment variables in Windows 10? for instructions on how to modify envronment variables (like PATH).


Tuesday, November 28, 2017

linux - mkfs.ext4 errors

I've just installed Kali Linux and am working with an img file I created from dd (/dev/zero). When I go to do mkfs.ext4 on it, I get



mkfs.ext4: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.



I solved the above (made it too small). Still having the issue below



EXT4-fs (loop0): VFS: Can't find ext4 filesystem



To re-iterate, I get this when I try to mount any of the Kali Linux arm images. The desktop FS is ext4 according to gparted. Not sure what else the FS could be.


EDIT: I got it to mount on my mac via fuse. Though I'd still like to know how to do this via cmd. The single image mounts one msdos (vfat) and one ext4. How can I mount two at once out of the same image?

filesystem corruption - Does flash-memory integrity depend on system resources while reading/writing (like CDs/DVDs)?


I’m really concerned that flash-memory is just not reliable as a storage for irreplaceable files. Does anybody know if the integrity (corruptibility) of flash-memory (flash-drives, memory-cards—SSDs?) depend on the system and its resource load?


That is, if you are writing (or reading?) to a USB flash-drive or memory-card while the system is under a load (something in the background running the CPU at 100%, using up a lot of memory, or causing the hard-drive to thrash a lot), could it cause the data written to or read from the flash device to be corrupt?


I have recently gotten two brand-new flash-drives (a Kingston memory-card and a Kingston USB-drive). I copied a folder with a lot of files to both of them (at the same time), and when I compared them to the source (and each other), I found that some files were shown as being different. Some of them were false-positives and re-comparing them made them go away (they were suddenly identical again), while some were permanently corrupt (some had 8 bytes in a row different, some had several dozen in a row). After copying the corrupt files again and comparing them, they showed as identical.


It doesn’t seem to be system related (e.g., bad memory) because I’ve seen it happen on a laptop and desktop. Nor is it OS dependent; it’s happened on 64-bit 7 and 32-bit XP. It doesn’t seem to be related to the USB port or memory-card reader (again, different systems). It is not even the device itself (I’ve seen it happen on SanDisk and Kingston memory-cards and USB-drives). Unfortunately I can’t do any tests because while it’s not fully intermittent, it is random (I may be able to force it to happen, but would be unable to control the results).


The only factor that seems to be even slightly consistent when it happens seems to be the resource-load of the system that is reading or writing to the flash-memory. It’s almost as though the device cannot get the data fast enough—as though flash-drives and cards are sooo fast (¬_¬)—so it writes junk and moves on, much like how burning a CD or DVD requires a constant, steady stream of data without interruption to avoid corrupting the disc (even with a built-in buffer).


Is that really how flash-memory drives work? If so, why? Why are they not like hard-drives that simply take longer to perform the disk operation? Surely in this day and age, systems are designed to be dynamic and use variables and error-handling instead of expecting all operations to complete in an arbitrary prescribed amount of time and fail if it they are not.


Answer



edited:


After some interesting discussions with Synetech, and considering that he made several tests (different brands, different OS versions, different computers, etc), we found some tips on this Microsoft Technet discussion page


Some users consider that the problem can be related to USB voltage: sometime Windows, motherboard, etc, try to reduce power consumption, and taht can be critical when the CPU / computer is under high load. In those situations, the USB can be powered with a lower voltage than it requires, and then some erratic behavior can happen.


There are many possible solutions, that might or might not work for each computer:


1 - Tweaking the BIOS so that northbridge receives more tension for USB ports;


2 - Using a powered USB hub;


3- Disabling ACPI control.


Windows 8 upgrade offer: will I be able to format or forced to upgrade?











I'm considering buying Windows 8 Pro with Upgrade offer. I'm currently using Windows 7.



My question is very simple: Will the installation DVD to be downloaded be able to install Windows 8 from scratch or does it need Windows 7 to be installed?




I'm asking this because I will eventually format my computer and I prefer installing an OS from scratch rather from an existing installation.


Answer



You can still use the Clean Install trick from Windows 7 in Windows 8:




  • Install Windows 8 with your key

  • Open regedit.exe with Start Menu Search and navigate to:



    HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Setup/OOBE/


  • change the value MediaBootInstall from "1" to "0"



  • run slgmr.vbs -rearm and reboot

  • activate Windows 8.


windows 7 - Why can't I install win7 64 from hard disk?


My system is Windows XP, I want to install the 64 bit version of Win7 from hard disk.
1. I downloaded grub4dos and extracted files into the C: disk, copied win7.iso into the C: disk.
2. Edited boot.ini as the following:


[boot loader]
[operating systems]
c:\grldr.mbr="Grub4dos"


  1. Edited menu.lst as the following


    title install win7
    find --set-root /win7.iso map /win7.iso (0xff) || map --mem /win7.iso (0xff)
    map --hook
    chainloader (0xff)
    savedefault --wait=10



When I reboot and enter into installation, click install and next, I get these errors:



No device drivers were found, make sure that the installation media contains the correct drivers, and then click ok.



How to solve this problem?


Today, I bought a DVD drive and installed the DVD drive into my PC, then I installed Nero, and burnt the Win7 English 64-bit version ISO file on a blank DVD. I rebooted the PC and pressed F8, entered the boot menu, set DVD to boot. When rebooting, I successfully installed the English version of Win7 Professional.


I have more question to ask :



  1. Why can't the ISO file not be installed from hard disk? Why can I install it when i burn the ISO file on DVD?

  2. How can I build an ISO image which can be installed from hard disk?


Answer



If you already have an operating system installed on the computer
which matches your iso installation media as regarding bitness
(32-bit or 64-bit), then you can install Windows 7 directly from the iso file.


The procedure is as follows :



  • Boot into the existing Windows installation

  • Install a virtual disk tool such as the free version of DAEMON Tools Lite
    (refuse all adware offers when installing)

  • Mount the Windows 7 iso as a virtual disk (say it is called X:)

  • Open X: in Windows explorer

  • Execute setup.exe


This will copy the installation files to the hard disk and continue from there.


If the above method is not convenient for you, or the bitness does not agree,
or this is a bare-metal installation,
then you must create a boot DVD or boot USB key to install.


Monday, November 27, 2017

laptop - Troubleshooting input device detection in Windows Xp Pro Sp3


My laptop (Acer travelmate 4152NlCi)doesn't respond to the keyboard and mouse anymore while booting in Windows Xp Pro Sp3. i can't type the password and login. I have Opensuse 11.0 on it as well and it works. So I can boot into Linux and not Windows, not even in safe mode. What would be the troubleshooting steps?


Answer



Perhaps try using a USB keyboard and mouse. Plug them in when Windows is on the logon screen and wait about 30 seconds for the new devices to be installed. If that lets you log in, then you can check Device Manager and see if your built-in components are even being detected.


If that doesn't work, you can try using Remote Desktop to connect to the computer once it boots up. If you don't have Remote Desktop turned on, you can try using PsExec to enable Remote Desktop from a second computer. Once you've connected via Remote Desktop, you should be able to check why the local machine isn't accepting input.


If you can't get Remote Desktop started, you can try using a VNC tool like Fastpush to start a VNC server on the problem computer, then connect that way.


Getting Windows to boot first after installing Ubuntu on ThinkPad T430s



I just installed Ubuntu on my T430s. I installed it by creating a partition, disabling Secure Boot, and then booting from a USB that contains Ubuntu's ISO.



Now when I boot up my laptop, Ubuntu's grub boots Ubuntu by default. Even if I interrupt grub and try to choose Windows Loader from the menu, it fails with the following two errors:



error: unknown command `drivemap`.
error: invalid EFI file path.


Press any key to continue...


I don't care about repairing these errors because I can still boot Windows by interrupting the initial boot screen with F12 and then selecting Windows Boot Manager from the list of options, which includes both "ubuntu" and "Windows Boot Manager".



But I do want to have Windows boot by default and only boot Ubuntu when I interrupt the boot screen with F12. Could someone please tell me how to achieve that?


Answer



The solution in my case was very simple. All I had to do was go into the BIOS setup and find the Boot menu and change the order of boot items. I put Windows Boot Manager before Ubuntu and now things work fine. :)


Sunday, November 26, 2017

bios - How to use external display as default

When I use my external monitor with my laptop, the external monitor begins to display when the OS starts to load, unlike the internal monitor in the laptop, which begins to display from the beginning, including the OEM Logo and bios.

It is the same when I connect the monitor to my old laptop or my friend's laptop.

It doesn't matter at first, but recently I go an embedded machine, I want to use the external monitor to setup OS, although the monitor detected signal, but do not display anything.

The embed machine is functional, because it worked when I use my friend's monitor.

So how to make a external monitor work as the default monitor of a computer, so it can display when booting up like desktop?

Or there are differences that some monitors can and some can't?

boot - How to *actually* make a multi USB bootable disk in a reliable way. Without ruining its USB mass storage capability

I have tried countless bootable USB makers. When they work, they work pretty well.


Here's a list of tools I've tried.



  • YUMI

  • Unetbootin

  • Rufus


The problem is that they don't always work. The mode of failure isn't necessarily obvious. Perhaps the drive itself isn't compatible with the method used. Sometimes the drive isn't prepared properly for the tool ahead of time, and the tool doesn't even provide documentation that specifies what you need to do with the drive in order for it to work properly.


At any rate, I will attempt to describe the ideal situation, in increasing levels of system administrator user experience.


Mandatory: The USB drive shall be bootable in systems which support booting from USB. This should be the majority of computers. The USB drive shall NOT require a working operating system to exist on a working hard disk which is detected by the system, indeed the USB drive shall boot on a machine with no storage attached other than the USB drive in question.


Very much desired: The USB drive, after preparation, shall be mountable and writable and readable under Linux, OS X, and Windows, for use as an emergency mass storage device for storing < 2GB files as free space allows. Some directory in the root of the filesystem may be specified such that any files placed in there are LEFT ALONE by the preparator program as necessary.


Important: The USB drive, after preparation, can reliably be extended with a GRUB or similar menu to pick and load more ISO images. I want it to be EASY, not next to impossible, to make a 128GB bootable USB drive with a bunch of linux liveCDs, a bunch of Windows install ISOs, a bunch of diagnostic tool ISOs.


Extra credit: The USB drive is prepared once initially. It will be capable of dynamically scanning itself for ISOs loaded onto it via mass storage, and provide the GRUB picker or equivalent, dynamically, in which ISOs which were loaded onto the drive can be picked and booted. This means I can prepare the drive, then take it to other computers which have ISOs, load them on, and then take them to yet other computers to boot these new ISOs...


Is this too much to ask? Is this even possible, theoretically? Yes FAT32 won't let you put large ISO files onto the drive. That's not a good enough reason, though. This is goddamn 2016... the drive could just load something that can read exFAT to get at the ISOs stored on it...


These days I find that I am reformatting and rewriting images onto USB drives over and over and there is no reasonable way to maintain these things. Most of the tools that let you load multiple disks will unpack the image and drop files into directories, and eventually when booting files won't be in the right place or something and things fall apart. once this happens, the content on the disk is basically a lost cause.


So an alternative approach is to e.g. on a Mac hdutil convert -format UDRW and then dd to basically raw copy the iso to the USB drive. This has a very good chance of creating a solid USB drive, but now this USB drive is unreadable inside an OS and cannot be used as an emergency mass storage device. Neither can you ever have more than one image to boot this way, rendering the majority of the capacity of the drive useless.


For inspiration see the isostick. I actually have one of these. I haven't been using it much because it's freaking slow, and is USB 2.0 only. I have some USB 3 sticks I've been using but I'm really being fed up with loading images back onto my sticks over and over. At this point if I can have a solution that I can count on to work, I'll be happy waiting the few extra minutes eating my sandwich, rather than babysitting these AWFUL image loader tools. It's really not an ideal solution though, because 128GB USB3 drives with 130MB/s read speed are had for under 50 USD. Our software is really behind the curve at this point. Please just give me the speed and the flexibility.


I really hope someone who knows how this syslinux/grub stuff works can explain like I'm five why the hell I can't have this all done in software.

Install Windows 7 x64 from a separate partition on same hard drive (no DVD/USB)?



I'm currently running Windows XP 32-bit, and want to install Windows 7 64-bit. However, my DVD drive is broken, and the only USB sticks I have lying around are USB 1.1 only (SLOW!). So I tried (as suggested would work for a USB stick by several online guides):




  1. Created new primary partition (formatted NTFS)


  2. Set that partition as active

  3. Copied contents of Win7 x64 ISO

  4. Downloaded the 32-bit bootsect.exe

  5. Ran bootsect /nt60 F:



However, when I boot into the new partition, I only see a blinking cursor on a blank screen; nothing happens. Any ideas?


Answer



I did this once with a computer. I had no DVD or USB with me, so this is what I did.





  1. Download the iso from DigitalRiver.

  2. Open Disk Management (diskmgmt.msc).

  3. Shrink your current drive by 5GB.

  4. Format the unallocated space in NTFS.

  5. Assign it a drive letter. I recommend using Z:, as it is easy to remember and to use.

  6. Extract the files in the ISO using 7z to your new partition you just created.

  7. Using EasyBCD, go to the "Add New Entry" tab.

  8. Click on WinPE.

  9. Give your boot entry a name. I used Windows 7 Installation


  10. In the third box, select YourDrive:\Sources\Boot.wim

  11. Save it.

  12. Reboot.

  13. When the boot menu comes up, select the entry you created using EasyBCD.

  14. When the installation screen comes up, follow the instructions.

  15. Enjoy your Windows 7 installation.



Note: During the installation, I wiped my other partitions and installed it on the wiped partitions. If you want to upgrade, select upgrade instead of Custom.


USB pen drive suddenly became read-only



Kingston DTSE9 16 Gb USB pen drive (genuine one) suddenly becomes read-only. It has been used in a car, permanently plugged in into the USB socket as music collection for approx 6 months. It was barely written to, 5 times max. It could have been exposed to extremely low temperatures (-2 degree Celcius, Manchester, UK).


Any attempt to format or partition fails. I have searched internet. I have tried OSX, Windows and Ubuntu. I can afford to throw it away and buy 10 new ones (wasted much more time already trying to format it) - but it's a matter of principle, right?


My guts telling me it is possible to mount it manually in Unix/Linux in a special way - but I'm not strong in that. Any suggestions from a unix command line gurus who appreciate matter of principle? Or is it the time when machines are beating human yet? I know this site is the best on the internet, so if no-one here can help then no point fighting it further.


Oh. There is no physical write protection switch on the drive


Image on the pen drive: no physical switch


Attempt to partition pen drive using OS X




Answer



You can try booting into a Linux system, and remounting it as read-write.


First, boot up your computer to any Linux. Then, plug your usb drive into your computer. (assuming the drive isn't dead from driving)


In this case, I will assume your drive is called

/dev/sdb

You can check this by doing fdisk -l when the drive is not plugged in, and doing it again when it is. Then compare the results.

Once you have found out what it is called, you can try remounting it as read-write.


sudo mount -o remount,rw /dev/sdb

At this point, it may complain that it is write-protected.
In that case, you may also have to run sudo hdparm -r0 /dev/sdb


Then try remounting read-write again.


You should then be able to format it.
You can do this with:


sudo dd if=/dev/zero of=/dev/sdb

Be careful with this command, a mistype with dd can format your HDD.


If you want to work on a specific partition, you will have to specify a number after the drive name. (eg.

/dev/sdb1
is your drive, partition 1)

If none of this works, can you try posting dmesg | tail after plugging it in?


Saturday, November 25, 2017

Why isn't the directory size the same as the sum of its children for Windows 10

I have a directory that contains a ton of music that it showing weird file sizes in Windows 10. When I click on the directory containing all the music, it shows 809GB and over 164k files. When I select all the folders and files within that directory to check the sum of their size, it shows only 9.14GB and 2k files. The difference here is staggering.


Though this question is very similar to https://superuser.com/questions/304474/why-dont-the-sizes-of-my-folders-add-up-to-the-size-of-my-hard-drive-in-windows#= it differs in the fact that I am sure I have selected all hidden files, and I double checked the filesize on Linux which confirms that the real filesize of the Music directory is around 9.14GB. I attempted to do the cleanmgr but no change was made to the parent directory's size


enter image description here
Note that the Old Music directory in C:\Sorted Drive\Music\Old Music is 809 yet all of the files in C:\Sorted Drive\Music\Old Music\Old Music is only 9.14GB


Update:
I've change some folder settings to see if some extra hidden system files weren't showing up when selecting all sub directories and files but there was no change.


I've moved the files to different folders and found that the filesize of the parent directory changes to some random value. Even changing the name of the parent directory can change the filesize

laptop - Replacement AC adapter models: PA 1650 02 and T UV 19 35


I'd like to know whether the one adapter can safely replace the other.


The original was a LiteOn model: PA-1650-02 Input: 100-240v 1.6A 50-60Hz Output: 19v 3.42A 65w


Although I thought I was purchasing the same model, I received something different.


T Power Model: T-UV-19-35 Input: 100-240v 50-60hz 1.0-1.5A Output: 18v-20v 2A-4A


Is it the sort of thing where close enough works? I'm not sure how these things function and a Google search didn't provide much information. Is anyone knowledgeable? Responses are much appreciated


Answer



Yes it's safe, the power output rating is between 2-4 V (which is in the range of the original) and the Amp's are in the range as well.


Power adapter ratings explain the amount of power it can HANDLE, not what it gives directly. Your 'input' means the adapter itself takes the 100-240v AC line using 1.5 amps and converts to DC current with a potential to deliver between 18-20V at a rating of 2-4A meaning it can handle a total load of between 36-80 W without delivering more power than is required to the device (probably through some sort of line/noise filters/etc).


Mind you the quality of the parts in the adapters can make a difference, but generally at the wattage ratings your dealing with you should be ok.


Always try plugging in the new adapter with the power off first (if you haven't already started using it)


Windows 7 freezes randomly






I have an install of Windows 7 that is a year and a half old. I never experienced any issues with it until the last few weeks. It started freezing from time to time. When I spend the whole evening on my computer, it may freeze 5 times or might not freeze at all, I can't find a pattern.


I read somewhere that it might be the latest updates, so I uninstalled everything since beginning of October (a bit before it started to happen.)
But it just happened again.


Event log and reliability are empty don't have any error in and I'm out of ideas on how to diagnose this.


Any thoughts?


Answer



have you done any ram upgrades recently? if you have test them out individually that should determine which ram is bad. Memtest is a good tool to use as suggested. Have you updated any drivers as well? sometimes drivers can conflict with other devices that may cause your machine to hang. But in most cause ram would be the best and easiest test. Software are a lot harder to find.


good luck


Friday, November 24, 2017

windows 7 - Toshiba Laptop blue screening

we have lot of laptop Toshiba which are blue screening.


I have rebuild the laptop, re-install GC drivers and remove wifi and netwrok drivers but still i keep getting blue screen on these laptops. the logs say somthing about GC drivers but its not that its the network card which is causing this. does anyone know the kb number which i can apply to make these laptop stop blue screening.
its happening on Windows 7 x64 Toshiba laptops.


We had same problem with HP(r840) laptop but after applying Windows6.1-KB2664888-x64 and Windows6.1-KB2665206-x64. We haven't had this problem on HP laptops.

How can I forcibly install an older driver on Windows 7?


I'm trying to downgrade my Realtek High Definition Audio driver, currently


Realtek High Definition Audio driver


It's not as simple as clicking "Update Driver..." because here's what happens:


Step 1
Step 2
Step 3


So, naturally, I tried uninstalling the driver. But, then, I cannot install the new driver without restarting my computer. And when I restart my computer, the default driver is already halfway through installation by the time I get back to the Device Manager dialog, putting me back to square one.


Is there a way to get around the "The best driver software for your device is already installed [...] Windows has determined the driver software for your device is up to date" prompt and force installation of an older driver?


Answer



I think you just have to persistently tell it no, and a force manual installation.


Follow these steps:



  1. Locate manually

  2. Let Me pick from the list

  3. Have disk

  4. Browse, find the INF and whatever other persistent manual is necessary.


With enough persistence you can even install a completely wrong driver into a driver slot, very rarely you could even cause a no-boot situation. Hopefully you know what it is and what belongs there for sure before forcing it in.


Thursday, November 23, 2017

Make a bootable USB to install Windows XP from Linux

I have a Dell Inspiron Mini 9 with only Ubuntu installed. I want to install Windows XP also, but I don't have and can't get an external CD drive, so I need to make a Windows installation from the USB.




All the tutorials I found use Windows to make the USB bootable. How can I make the same from Linux?

windows - Powershell script won't launch in task scheduler when running as my admin user



I have a task setup:




  • Run whether logged in or not

  • Run with highest privs

  • When running the task use the following account (my admin account)




Program / Script: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
Arguments: -ExecutionPolicy Bypass C:\Temp\test.ps1



test.ps1 contains:



Write-Host "Hello"


If I run this script as my normal user without run as highest privs, powershell launches and it works as expected.




When using the above settings though, it shows as running, then shows as completed with a result of 0x0 but powershell doesn't launch.



Any ideas what I'm doing wrong?



Note: I've tried setting the Start In to C:\Temp, I've tried various other arguments like noprofile nologo etc.


Answer



PowerShell is running in a different user-context since you run this task as a different user than you're currently logged in. That's why you don't see any PowerShell window.



To make sure that your script really runs, try creating a txt file in your script. if it gets created, your script runs.



Wednesday, November 22, 2017

security - What are these weird IP address connections in resource monitor?

I decided to check out Resource Monitor (on the 'Performance' tab in Task Manager, Windows 7) and I noticed in the "Network" section that the 'System' image name kept making a bunch (~5 at a time) of connections to random IP addresses, it would show anywhere from 1-500 bytes/sec 'sent'. They would stay connected for 1-2 minutes.


-All web browsers are closed


So, the first thing I did was run a trace from network-tools.com on some of these IP addresses. 8/10 were outside of US and did not resolve to any host name. Of the 10 IP addresses I traced, 2 were in US, 4 showed origins in China, and one each to Algeria, Russia, Pakistan, Korea. (!)


So, the next thing I did was turn off my wireless card, watch the connections disappear, then turn the card back on, and within 30 seconds more random connections were created by System, with different IP addresses from the first time.


The next thing I did was go open Task Manager, Show Processes From All Users, then I killed just about everything that wasn't (what appeared to be) a Windows process.


I turned on Wi-Fi, and again within 30 seconds, random IP addresses connect for ~ 1 min at a time, new ones coming and going.


I occasionally use BitTorrent on this machine, but there was definitely no process that seemed related to BitTorrent running after I went through Task Manager, and BitTorrent wasn't open to begin with.


So, any ideas on what these connections might be for?
I have been using Ad-Aware Free and AVG Free on this computer for a while now, always up to date.


UPDATE:
I ran netstat a few times with different options set, including netstat -a.
Even while I had the network resource monitor open and could see ~5 random IP addresses shown under the System process, netstat showed no connection containing any of these IP addresses.


Another interesting update: Yesterday, while random IPs existed, I downloaded and installed spyboy s&d. The random connections stopped, and I haven't seen them since. This happened before I even scanned using spybot s&d. The 'full scan' showed nothing other than 1 cookie.

windows 7 - Internet speed very slow only in WiFi and in just one laptop


I have Xfinity internet at home. All the devices (a couple of laptops, phones, tablets, etc) are connected via WiFi, except a PS3 which is connected via ethernet cable.


A few days ago we got the Xfinity gateway (router+modem) replaced because we had problem with it. I don't know if it's a coincidence, but around the same time I started to notice very slow internet in my work laptop. I've been doing speed tests in all the devices and they all seem fine (normal speeds) with the exception of this laptop (very slow speed).


I've been doing some tests:

  1. If I connect the laptop to the router via ethernet cable, the internet speed is normal again.

  2. If I boot the same laptop with Windows 8 (I have it with dual boot Windows 7 and Windows 8, but I usually use Windows 7), and do a speed test, the speed is normal again.

  3. I've restarted the router/laptop several times and speed via WiFi still very slow

  4. I've removed the WiFi network from the remembered networks of Win7 and connected to it again as if it was new network, and speed via WiFi still very slow


By slow speed I mean around 2Mbps when normally I would get around 35Mbps. The upload speed doesn't seem to be affected by this problem, it's usually 6-10Mbps.


Any ideas how I can get my laptop to get the same speed as always?


EDIT


So following the advice given in the first answer I reinstalled the drivers of the wireless card. I've been doing some tests with it and the rest of devices, and it seems that now I'm getting more speed that before, but the download speed still slower than expected. Although it fluctuates quite a bit, most of the results I get are around 10 Mbps, when before they used to be around 35 Mbps. Besides, it seems that in the rest of devices now it happens also the same (it's hard to tell because of how much the results change on each test). Can it be a hardware problem of the router/modem? Is there any way to test that? I called Comcast the other day and everything seemed fine on their end.


Answer



Because you mention that it works better in Windows 8, it could be a driver problem. Make sure you have up-to-date windows updates, including optional updates which sometimes have vendor specific hardware updates. Try locating your network adapter in your device manager, right clicking the adapter and select "Update driver software..." If this is already up to date, try uninstalling and reinstalling the driver. If this is a dongle and not internal card try searching for the driver directly from the manufacturer.


Laptop graphic card not working when battery is taken out but connected to power supply

I am trying to keep my battery life as much as possible so I tried taking out my laptop battery when i am gaming on it at home. However, when the battery is out of the laptop and plugged in to the power supply, my fps drops like as if i am playing on battery unplugged to power supply. How do I get it to work as if the battery is on the laptop and power supply plugged in?


I am using NVIDIA GTX 950M.

linux - Messy Filesytem : Duplicate File Removal from the command line

In debian/ubuntu I want to:


a) create a list of all the files in one directory tree
b) do the same for a second directory tree
c) compare the two lists such that, only the file NAMES are compared (i.e. just comparing the "file.txt" part so that "/home/folder/file.txt" == "/home/secondfolder/folder/file.txt)
d) output a list of all the duplicates


can anyone please explain how to do this using scripting languages or regex or something?

notepad++ - Find and Replace several several different values all at once


I have a file with multiple instances of Text_1 and Text1 and I need to replace both those strings with Text_A and TextB respectively.


Currently I'm doing two Find and Replace functions on each file one that finds Text_1 and replaces it with Text_A and the other that finds Text1 and replaces it with TextB.


Is there any way to do this all at once instead of having to run "Find and Replace" twice?


I am using Dreamweaver CS3, but I also have Notepad++, regular Notepad, OO Writer, MS Word if those will be easier. Ideally I could do this in Dreamweaver or Notepad++ but I'm open to downloading something else to get the job done. I'd prefer not to have to do any command line stuff or create a batch file (while I'm aware of it, I don't understand it really).


In case the above description isn't clear, let me explain it this way...


I want to run Find & Replace 1 time in 1 document and I want it to do ALL of the following during that one Find & Replace instance:



  1. Find Text_1 and Replace with Text_A

  2. Find Text1 and Replace with TextB


I am not trying to do a Find and Replace across several documents.


Answer



Take a look at Sed. You can easily achieve your goal by only one command line


sed -e "s/Text_1/TextA/" -e "s/Text1/TextB/" your_file_new.txt


Tried every option I can find, still can't make files not 'read-only' after windows 10 update

Recently update a computer to windows 10 and started getting an error from a program (solidworks) that boiled down to not having the permissions needed for a folder.


Issue is even if I open properties and uncheck read only it's checked again if I look again.


I've tried moving the folder to a different location on the computer, issue still stands.


I'm logged in as Admin, gone through properties, security, etc and ensured I have Full control for everything to do with it.


Tried 'attrib -r +s C:\drive' in cmd run as admin, no change.


I've been trying every option I can find, anyone have any other ideas or thoughts?

Tuesday, November 21, 2017

7 zip - Using a batch file to zip files as individual zip files



So I'm trying to use 7zip in a batch file to take the files in a folder and zip them as individual files. So the first file gets it's own zip archive, and the next and so on. I've been looking on the internet and tried a bunch of different codes. So far I've only successfully managed to zip them as a single zip file and it output to my desktop.



Unfortunately I lost the code that did that, and now I'm stuck with this which doesn't seem to do anything.




@echo on
cd "C:\Users\MVD21\Desktop\test"
FOR %%i IN (C:\Users\MVD21\Desktop\test) DO 7z.exe a "%~ni.7z" "%i"
pause


I want each file to have it's own zip archive, and for the zip archive to share the name of the file, minus the extension of course.



Any help is greatly appreciated.


Answer





I want each file to have it's own zip archive, and for the zip archive
to share the name of the file, minus the extension of course.




Batch Script



(Set the source and destination full explicit folder paths up top and then just run as needed. The source is where the files exist you want to zip and the destination is where you want those zipped to.)



@ECHO ON


SET SourceDir=C:\folder\source
SET DestDir=C:\folder\destination

CD /D "C:\Program Files\7-Zip"
FOR /F "TOKENS=*" %%F IN ('DIR /B /A-D "%SourceDir%"') DO (
7z.exe a "%DestDir%\%%~NF.zip" "%SourceDir%\%%~NXF"
)
EXIT



Command Line



FOR /F "TOKENS=*" %F IN ('DIR /B /A-D "C:\Folder\Source"') DO 7z.exe a "C:\Folder\Dest\%~NF.zip" "C:\Folder\Source\%~NXF"





Further Resources





HP Pen drive not being detected in Windows after being made into bootable Ubuntu install drive


My HP250W 8gb USB pen drive is not detecting only on my Windows OS. But it is detecting on side-by-boot Ubuntu and also on other machines regardless of the OS. Other pen drives also detecting in my Windows. With these facts, I'm pretty sure that there is no complaints in my USB ports and the pen drive.


PS: It stopped detecting in Windows only after I used my pen drive as a bootable Ubuntu installer.


I smell there is something wrong with registry. But couldn't say for sure.


Answer



Look at the device manager (Start, "device manager") and see if the drive shows up there in windows. If it does, you should be able to reinstall the driver and reformat it if necessary.


New router, slower internet connection?

We just bought a new router a few hours ago, and it does work. However, for some reason the speed is just ridiculously slow (compared to before, at least)! If I run a test on speedtest.net I get the following results:



Which are pretty good. But for some reason it's like the connection just "hangs" for a second when I navigate to a site through the browser (have tried different browsers). It's not on all sites, it kind of happens randomly. I think the browser cache might be speeding some sites up, because if I visit a site that I HAVEN'T visited before (since I cleared my cache), it takes like two seconds (if not more) to open the site. If I have visited it, it opens directly (it barely loads).


Not sure what to do, really. Any suggestions on what might speed it up? Any settings I can play with in the router settings?


The router is of the brand Belkin. I'm not sure about the model though, it says "Belkin, Play Max Wireless Router" on the box?


EDIT: Alright, it takes a lot more than two seconds. At least 3-4 depending on the site. Any suggestions?

windows 7 - Battery stops charging at 84% and gets very hot


My laptop battery always charges to about 84% to 87%. Once it reaches a charge level in that range, it stops charging, but Windows says it is "plugged in and charging". Because it has not reached 100%, it keeps trying to charge the battery, but instead of charging it gets very hot. It causes CPU temperatures of about 51°C (normal temperatures range from 35°C when idle, to 43°C when running an IDE and a compiler).


The machine is an HP Pavilion dv7-6157cl running Windows 7. I have set the fan in the BIOS to run continuously, and it is always on a table or some surface which allows plenty of airflow to the vents on the bottom.


I have reinstalled the battery drivers and updated all of the other drivers. Nothing seems to help. I have also tried calibrating the battery. I also tried changing several power settings. The problem persists.


However, it works correctly as long as the charge does not exceed 84%.


What might be causing the problem? Is there a way I can get Windows to stop charging the battery at about 80%? Should I get a new battery?


Answer



Battery heating can be a sign that there's a bad cell in the stack.


The other cells charge up to full capacity and the bad cell then just turns into a resistor, creating a lot of heat as it dissipates the wasted current, and in the case of Li-Poly, eventually smoke.


Sunday, November 19, 2017

windows 7 - Delete folder, subfolder and files in long path


I have tried solving this problem by googling and browsing superuser.com, but haven't found a viable solution yet. I'm running Windows 7 btw.


I somehow got Arduino to recursively create folders named "libraries" within the parent-folder called libraries. Somewhere down the path, there are also some library-files and now I can't delete the damn thing.
The path is so deep, that I can't enter it all the way down to the files.
Every time I try to delete the files I get an error saying either something like "path too long" or "Directory not empty".


I have tried deleting it through the cmd.exe using:


del /S /Q libraries\*
rmdir /S /Q libraries

I also tried robocopy, as some threads mentioned this as a solution.


robocopy ROBCOP libraries /s /mir

And finally I have tried using a tool called DelinvFile. This tool started to delete the folder, but after deleting ~6000 subfolders, it stopped with the error "Directory not empty".


Answer



I tryed different types of software, including some recursive deletion tools. In all cases the software crashed.


I managed to delete the folder, by installing a version of Ubuntu on a USB-stick, booting it up in Ubuntu and deleting it through the terminal using the recursive (-r) parameter. It took between 5-10min for the computer to delete the folder (amazing, as it only contained folders and 300kb of data).


After reboot, Windows felt the need to repair windows. I got a notification saying Windows wasn't able to repair, but when I booted up again everyting was working perfectly.


Saturday, November 18, 2017

google chrome - Why do images from some Tumblr pages not load, but using wget on them works?



Helping a friend out with their Internet connection because “some pages won’t load”, I noticed that the problem was that the images of certain blogs' image posts weren’t loading on the browser. I found it weird because of the following reasons:





  1. Only images that are part of the post won’t load. User avatars, banners, headers, various theme and/or page-related images still appear.

  2. Happens with any browser on the computer (Tested on Firefox and Chrome/ium both with and without ad/script blockers).

  3. Using wget on the images' direct links works.

  4. This does not apply to all Tumblr pages. Most load properly, but when making a list of pages with posts that don’t load images show that they’re mostly from the same bunch of users.

  5. The problem seems to be blog-specific in the sense that if a certain blog's image post doesn't load in the browser, other blogs (unaffected or not) that reblogged the same post won't load the image in the browser as well. Conversely, if an affected blog is reblogs from an unaffected one, the image loads fine.

  6. The images are from user-created Tumblr posts where the user uploads an image to post and are hosted by Tumblr. For example (this example is not one of the affected blogs), in this image post (randomly selected), this would be the direct link to the image in the post. Image posts automatically make the images a link to another page in Tumblr using a (usually) larger version of the image used in the post that is closer to the size of what the user uploaded for the post.



What can possibly be the reason for this happening? The part that really gets me is the fact that wget works, so I think I can assume that it’s not a problem with the network connection.




Update:



Here is an example of a reblogged post that fails to load on the browsers. The main blog has other image posts that load properly. This is the direct link to the image in the post and here is the one for the bigger version (both don't load here). wget works for both, but upon going to any direct link with Firefox, this error appears:



This XML file does not appear to have any style information associated with it. The document tree is shown below.


AccessDenied
Access Denied
A626307DF577B411

J9GxX1HY9vX3ElWjYf7M48ByvKXLRIwRBJ2al2voS3J/C+WhILWHyd3crFhhNtkXuvG0zaxBTxw=



RequestID and HostId changes every time. My friend and I are located in the Philippines.



Update [2014/03/08]



Upon further tests and replying to the emails of Tumblr support, wget has stopped working (getting 403 errors on direct links) on some occasions.




Update [2014/03/09]



Turning off the Tumblr rules for HTTPS-Everywhere seems to sometimes fix the problem.






Note:




  • In the example for #6, direct links both point to the same image. Usually, though, the one used in the image post (as compared to the zoomable image page) uses a smaller version of the image to fit the theme of the page. The example uses a theme made for larger screens so it does not need the smaller version.



Answer



UPDATE: It seems the core issue with images not loading stemmed from the way the EFF’s HTTPS Everywhere plugin/extension handled some Tumblr URLs. The developer’s were notified and a fix appears to be in place. This answer basically breaks down the detective work done to uncover the issue as outlined by the initial question and could prove useful for further debugging/diagnosis if a similar issue appears in the future.






EDIT: The larger content about image leeching seems invalid. So will add a new idea at the top and leave the image leeching info at the bottom just in case it is useful to someone.



Amazon CloudFront CDN Ideas




Okay, using the URLs you have provided—as well as some of my real world experience with Amazon CloudFront CDN setups—I think I discovered something. It seems like Tumblr’s Amazon CloudFront CDN config is choking for some reason. Here is why I think that is the case.



Let’s take this example URL:



http://36.media.tumblr.com/d685b02fdf2d3f167c22d9a97e27e87a/tumblr_nfpq5qPZ4v1tognpro1_1280.png


Now let’s run curl -I to get header information on that file:




curl -I http://36.media.tumblr.com/d685b02fdf2d3f167c22d9a97e27e87a/tumblr_nfpq5qPZ4v1tognpro1_1280.png


The output for that would be something like this:



HTTP/1.1 200 OK
Content-Type: image/png
Content-Length: 782141
Connection: keep-alive
Accept-Ranges: bytes

Cache-Control: max-age=1209600
Date: Thu, 05 Mar 2015 02:15:44 GMT
Server: nginx
X-Cache: Miss from cloudfront
Via: 1.1 7e54fc06cd70e4752fe050bbe5c130be.cloudfront.net (CloudFront)
X-Amz-Cf-Id: QyIUyzfaJJN3PU_xWkW0P-D2kjg_1cVenKzFAoY2PubgZQlBHWorZQ==


Now the things to pay attention to here are the Date (the date and time of the file on the CloudFront endpoint) and X-Cache (Amazon content delivery status) headers. Typical behavior on Amazon CloudFront is the first access will convey a “Miss from cloudfront” and then if you do another curl -I right away afterwards there should be a Hit from cloudfront.




But that’s not what I saw just now. Here is a breakdown of the Date and X-Cache status of a bunch of accesses I made:




  • Date: Thu, 05 Mar 2015 02:19:37 GMT = X-Cache: Miss from cloudfront

  • Date: Thu, 05 Mar 2015 02:19:39 GMT = X-Cache: Miss from cloudfront

  • Date: Thu, 05 Mar 2015 02:19:44 GMT = X-Cache: Miss from cloudfront

  • Date: Thu, 05 Mar 2015 02:19:50 GMT = X-Cache: Miss from cloudfront

  • Date: Thu, 05 Mar 2015 02:19:50 GMT = X-Cache: Hit from cloudfront

  • Date: Thu, 05 Mar 2015 02:19:50 GMT = X-Cache: Hit from cloudfront

  • Date: Thu, 05 Mar 2015 02:19:50 GMT = X-Cache: Hit from cloudfront




The reason why there are multiple items with the same exact data which are Hit from cloudfront near the end is because that is what happens on a CDN: If the endpoint of the CDN has the file, then Date correlates to the actual creation/modification date of the file that endpoint has.



You notice the first four access are seconds apart, with different dates/times and all of them are Miss from cloudfront, right? That means the CDN endpoint is just echoing back that there was an attempt to access that file at those times and all attempts were misses.



So my armchair assessment of this is that Tumblr’s systems are not keeping up with the Amazon CloudFront CDN or the Amazon CloudFront CDN is not keeping up with Tumblr. But in some way, things are amiss on their server side. And since this is a CDN, someone accessing the files in one location might not notice an issue while someone else in another location would have issues viewing the image.



Which is all to say, I don’t think this can easily be cleared up on the client side.







EDIT: So the original poster added some new URLs, and this still points to a server-side issue, but I just wanted to post the details for the record.



EdgeCast & Highwinds CDN Ideas



So the original poster added more specifics, so here are more details based on the blog post that is being used as an example:



http://claystorks.tumblr.com/post/112741831192/soulmister-claystorks-windspeare-explain



And these image URLs are provided as examples of URLs in that post:



https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/76493f424ebb3b62d6de43e53643180a/tumblr_nkps82DdCh1sjn35qo1_500.png

https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/76493f424ebb3b62d6de43e53643180a/tumblr_nkps82DdCh1sjn35qo1_1280.png


And those two image URLs do indeed fail. But from my side—looking at the original soure code of the blog post from Brooklyn, New York, USA—I am not seeing those EdgeCast (gs1.wac.edgecastcdn.net) URLs. Rather, these are the URLs I am seeing:




http://41.media.tumblr.com/76493f424ebb3b62d6de43e53643180a/tumblr_nkps82DdCh1sjn35qo1_500.png

http://41.media.tumblr.com/76493f424ebb3b62d6de43e53643180a/tumblr_nkps82DdCh1sjn35qo1_1280.png


So my first thought is why is the original poster seeing those EdgeCast (gs1.wac.edgecastcdn.net). But then if I do a traceroute to the 41.media.tumblr.com I see that is a server managed by Highwinds (!?!?). In contrast the initial URLs passed on by the original user are using the 36.media.tumblr.com hostname and you can see they are managed by Amazon CloudFront CDN servers.



Which is all to say—which I said before—all of this seems to be a server side issue with Tumblr and their CDN management. But from my side—in Brooklyn, New York, USA—I am clearly seeing content being delivered as expected from Highwinds CDN servers as well as Amazon CloudFront CDN servers. Where these EdgeCast URLS are coming from or how/why they are then failing is out of anyone’s control on the client side. This would definitely be something to contact Tumblr tech staff about because there is no way a desktop end-user could resolve this.







Image Leeching Ideas



Might not be relevant anymore, but here for reference.



You stating this give me a clue:




Using wget on the images' direct links works.





Many sites have rules in place—usually set via Apache—that prevent image leeching. More details on how those rules work are provided here and is summarized as this:




Using .htaccess, you can disallow hot linking on your server, so those
attempting to link to an image or CSS file on your site, for example,
is either blocked (failed request, such as a broken image) or served a
different content (ie: an image of an angry man).





Based on your description—and the fact you can access the images via wget—leads me to believe that the images you are having issues with are not hosted on Tumblr by users, but rather images that are placed on a Tumblr blog but actually hosted on another site.



When standard image leeching procedures are put in place, viewing an embedded image on one site that is hosted on another site—which blocks leeching—would result in a broken image link or perhaps a “Stop Leeching!” image being returned. This is because basic anti-leeching rules—such as those in that example page—crosscheck image referrers to make sure the page requesting the image matches the domain hosting the image.



So when you are accessing the image via wget you are accessing the image directly. So image leeching rules would not kick in. Thus you can get the image via wget but not when it is embedded in another page.


How do I activate Windows 10 Pro on a laptop that came with Windows 10 Home?

I have a laptop here that came with Windows 10 Home pre-installed. But I want the more feature-rich Pro edition instead. I have access to the Microsoft DreamSpark program through collage. So I have ordered a new license key for the "Multiple Edition". This is thought to be a Home and Pro bundle in one ISO file, but the license key activates only the more feature-rich Pro edition. This is according to a forum thread on tenforums.com.


I have now done a clean install using the provided ISO file. But the installer never prompted for a license key? I did get a 25 character key from DreamSpark. Once the installation was done, and I connected to the network, it appears to have been activated, and it's licensed to "Windows User"? But the installed edition is still just "Home"?


How do I go about to activate Windows 10 Pro edition on this Windows 10 Home laptop?


The currently installed Windows version is 1607, build 14393.0. This is definitely not the build that came with the laptop. The PC came with the TH1 update (some 10.0.10240.x build). This indicates that the install went well, but this activation thing is a puzzle.


Update 1:


In any normal operating system world, the solution provided by Timmy should be the correct solution. And it is the correct path to follow, except for the fact that it doesn't work properly. But that's a problem of Microsoft and Windows itself.


I followed the instructions provided by Timmy. Except I did not use the "Go to Store" link, but the "Change Product Key" link. But this should not be important, as both links seem to lead to the same "Enter a product key" prompt.


This appeared to be working. A Microsoft Support rep even confirmed that my Pro key had in fact been activated. The PC rebooted and some "upgrading" message appeared on the screen. So all was well... except for the fact that the Home to Pro upgrade installer program appears to be broken, because it failed to properly enable all of Pro features and benefits. It only enabled some of them.


One of the features it failed to enable is the lusrmgr snapin. It seems to suggest that I am using Windows 10 Home edition.



This snapin may not be used with this edition of Windows 10. To manage
user accounts for this computer, use the User Accounts tool in the
Control Panel.



lusrmgr


Even though Microsoft confirmed that Pro edition had been activated, and I saw some upgrade installer reboot my PC. But apparently this installer has issues.


So I will have to use the clean install (WinPE) method/installer. But for this to succeed I need a way to prevent the installer from automatically reading my UEFI embedded key and configuring Home edition during install. I need an override method for this automation. I need a way to provide the installer with the Pro key manually before the installation starts. The method given by Daniel seems promising. I will post back if it works.


Update 2:


Essentially, the first answer that was provided by Timmy is the correct solution to my question. If it were not for the road blocks due to buggy Microsoft software!


So my original question has turned into at least two separate problems.



  1. Why is lusrmgr.msc still not accessible now that I have
    successfully activated Pro edition?

  2. How to prevent clean install method (WinPE) from using my PC
    embedded key for the installation, or how to force it to prompt me
    for a key?


I will post back if and when I overcome these damn roadblocks. I can't possibly wait for Microsoft to get their head out of the cloud and fix the Home to Pro upgrade installer. So being able to answer my second question here seems like the best shot at correctly configuring Pro edition on this PC.


As always, the clean install method has proven to have the best outlook at fully and successfully installing, configuring and activating Windows. I just wish it wasn't so much more automated in Windows 10, with little to no user control over the process. It bases its decisions on a lot of predictions, trying to outsmart the human sitting in front of the screen. Since it's just a stupid computer, it has no concept of understanding user choice or preference. I think I know my own PC better than Microsoft and Windows put together. Not to mention my own preference and choice. No one else knows that better than I do.


Update 3: second install


I have done another clean install. Microsoft support asked me to do this. I have documented the entire process for future reference.


As I explained earlier, this PC came with Window 10 Home pre-installed by Asus. So it was an OEM type of thing with some minor bloatware. I used the ISO file that I got a link for from DreamSpark store and Rufus 2.10 to create a bootable USB flash drive.


The file was:


en_windows_10_multiple_editions_version_1607_updated_jul_2016_x64_dvd_9058187.iso


This installed Windows 10 Home and got activated automatically by the installation process. This PC is a laptop, and it has only WiFi for connectivity. And! I did not connect to the WiFi AP during setup. So it had no chance at activating over the Internet. The installer must have used the pre-activated key that's embedded on the machine.


Microsoft support representative used a remote session on my PC to try to sort out any issues with enabling Pro features. All attempts failed so they asked me to do a clean installation. Again?! So I obeyed and did another installation.


They gave me a link to download the latest Windows 10 build ISO file.


The file was:


Win10_1607_English_x64.iso


I used Rufus 2.10 again to prepare a USB flash drive. The installation completed again, and again, I had Windows 10 Home instead of Pro. As I suspected, the installer picked up the embedded Windows 10 Home key and configured Home edition. It failed to prompt for a key, just like the last time.


I tried to upgrade from Home to Pro using the same steps, and again, the upgrade installer failed to enable all Pro features. But Windows 10 Pro activation worked fine, just like the last time.


So I have clean installed Windows 10 Home not once but 2 times now since I left the bloated OEM Windows that came with the PC. I used 2 different official Microsoft ISO files, both with the same result. I also formatted the Windows partitions both times. I made my partitioning scheme on the first run, and I reused my existing partitions on the second run instead of having to recreate my partitions. But I made sure to format the target partition that I installed Windows on.


Windows 10 Home clean installed and activated:


system


You can see that it says "OEM" at the end of the product ID. So yes, the installer did use the embedded key for the installation... again.


lusrmgr


gpedit


secpol


system properties


enter a product key


After half successful Home to Pro upgrade:


upgrade your edition


preparing for upgrade


upgrade complete


system


You can see that it says "AA338" at the end of the product ID. This activation did not use the OEM key.


lusrmgr


gpedit


secpol


system properties


Update 4:


I tried disabling Secure Boot and performing a clean installation using the Win10_1607_English_x64.iso image without any modifications.


On some systems, disabling Secure Boot effectively prevents the Windows installer from reading the embedded key. This did not work on my PC. Windows 10 Home was installed, just like the last two times. It did not prompt me to enter a key which was the expected behavior.


Update 5:


I have successfully installed Windows 10 Pro cleanly using the ei.cfg trick. Apparently, this good old trick still works which is great. It works regardless of whether or not Secure Boot is enabled.


enter image description here

Why is checking Windows Update so slow?

I have Windows 7 PCs that have automatic update turned off. I do updates in batch once a month or so. But each time "check for update" takes 15 to 30 minutes. I don't understand why checking for updates can be so slow? I have to wonder what is happening in the background. Is it computing hash? Are my PCs with automatic updates enabled suffer the same fate every time it boots up (only that I wasn't aware)?

windows - Randomly execute 35 Batch files

I have 35 batch files in same folder. All batch files have different names and codes inside, i want to create batch file from where i can run 35 batch files randomly with out knowing their names or any characteristics. i created this batch file


@echo off
:loop
SETLOCAL ENABLEDELAYEDEXPANSION
if exist "C:\Users\Administrator\Desktop\converted\*.bat" (
for %%b in ("C:\Users\Administrator\Desktop\converted\*.bat") do (
set /a n=!random! %%35+1
start "" /w "C:\Users\Administrator\Desktop\!n!.bat" "%%b"
ping -n 20 localhost >nul
del "%%b"
)
)
ping -n 60 localhost >nul
goto :loop

but in this case i need to change all batch files name which is not recommended.looking for solution.

HP Pavilion Media Center t3777.uk, motherboard P5LP-LE (Leonite), memory expansion

I'm pretty much a novice when it comes to upgrading computers (have replaced power supplies and graphics cards, but that's it). The computer above comes with 2Gb (2x1GB PC2-5300 MB/sec) occupying two of its four 240-pin DDR2 DIMM sockets. According to the hp motherboard page it supports PC2 3200 (400 MHz), PC 4200 (533 MHz) and PC2 5300 (667 MHz) DDR2 DIMMs, non-ECC memory only, unbuffered. My research has revealed that UDIMMS = unbuffered DIMMS. The same page states that the maximum HP/Compaq approved memory is 4 GB and that 32 bit PCs cannot address a full 4.0 GB of memory.


I am planning to backup all my files and reinstall vista as 64bit which I think I have worked out how to do (although the bios issues referred to in this thread on the hp support forum thread suggest this might not work in which case only about 3.5Gb of memory will be addressable anyway, still better than now. I'm also planning to put in the fastest supported CPU and a new cpu cooler, plus a much better PCI express X16 graphics card (I have 1Gb and 2Gb cards available and will research which to use depending on total memory addressable). I have bought 4Gb (2x2GB PC2-5300 MB/sec DDR2 DIMMs, non-ECC (edit - unbuffered) memory) with the intention of expanding the RAM to 6Gb (with my existing memory).


The thread above mentions the possibility that adding more than the recommended maximum of 4Gb of memory, and using 2Gb sticks in a board designed for 1Gb sticks might damage the motherboard (although the questioner in that case had done both successfully). My question (to which I have not yet been able to find an answer) is, how might this damage the motherboard? Finding out the answer to this will help me assess the risks involved before trying it out.


My research reveals only rather vague answers of the type "no, it won't explode! :)" (answer to Superuser Q) or "possibly damage the ram and motherboard. DO NOT DO IT..." (answer to Tom's Hardware Q) to "most system these days protect from such mistakes" (answer to Spiceworks Community Q).


I hope this is a suitable question for this site and that I have met the research requirements successfully.

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...