Linux HowTo: Stop scanningcontention on dual boot win7 win10 system

Original Source Link

I have a win 7 install, which I have added a drive and installed win 10 on a separate drive. To stop each windows install from messing with the other disk, I have disabled those disks in the device manager on each install. (In win 7 the windows 10 disk is disabled and vice versa).

I have a shared disk that can be seen by each install

There are two problems:

  1. The shared disk (lets call it e:), every time I boot each installation wants to scan it. Can I disable chkdsk to stop it from checking the drive on boot? ( I still think it would be good to enable chkdsk on the booting drive)

  2. Even if I press a key and get out of the chkdsk on boot, I can hear the drive being scanned by some process, what I think is happening is the security descriptors are being checked by some process and found to be different (I noticed this after I booted win7 after win10, while I was in win7 after about 10mins the drive activity stops)

Any clue as to what is going on with scanning after windows starts?

Is it the security descriptors or another process that is scanning the drive?

The solution is to disable indexing, each time a different operating system is booted, the indexing system starts to re-index each drive.

Indexing can be disabled by going to the drive, selecting properties then disabling the “allow files on this drive to have contents indexed” to be unchecked (in the general tab).

The best way that I’ve found to stop one operating system from checking the others disk is to disable the disk’s drivers in the device manager

Tagged : / / / /

Making Game: How can I follow a windows shortcut in power shell?

Original Source Link

I am using powershell and I have a shortcut to my destination directory in the current directory. I want to change the current directory to the one pointed to by the shortcut. Logically what I want to do is:

cd your-files-here.lnk

and wind up where over that points. What I get instead is:

Set-Location : Cannot find path 'your-files-here.lnk' because it does not exist.
At C:Windowssystem32WindowsPowerShellv1.0ModulespscxModulesCDPscx.CD.psm1:111 char:17
+                 Set-Location <<<<  $path -UseTransaction:$UseTransaction
    + CategoryInfo          : ObjectNotFound: (your-files-here.lnk:String) [Set-Location], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

I tried

ii your-files-here.lnk

But this opens an explorer window instead of changing the current directory.

You may add this to your Microsoft.PowerShell_profile.ps1 file. The cd command will then work as desired.

remove-item alias:cd -force
function cd($target)
{
    if($target.EndsWith(".lnk"))
    {
        $sh = new-object -com wscript.shell
        $fullpath = resolve-path $target
        $targetpath = $sh.CreateShortcut($fullpath).TargetPath
        set-location $targetpath
    }
    else {
        set-location $target
    }
}

Unfortunately, Windows does not make it easy to work with shortcuts. This should work:

$sh = New-Object -COM WScript.Shell
cd $sh.CreateShortcut('your-files-here.lnk').TargetPath

Is the shortcut a necessity?

You could use a Windows link for this. See mklink /? for more information on Windows links/junction points.

Not really an answer to your question, but there is a module you can add to powershell that helps with quicker navigation – called “z”.

Here is more info: https://www.hanselman.com/blog/SpendLessTimeCDingAroundDirectoriesWithThePowerShellZShortcut.aspx

Tagged : / /

Linux HowTo: How can I follow a windows shortcut in power shell?

Original Source Link

I am using powershell and I have a shortcut to my destination directory in the current directory. I want to change the current directory to the one pointed to by the shortcut. Logically what I want to do is:

cd your-files-here.lnk

and wind up where over that points. What I get instead is:

Set-Location : Cannot find path 'your-files-here.lnk' because it does not exist.
At C:Windowssystem32WindowsPowerShellv1.0ModulespscxModulesCDPscx.CD.psm1:111 char:17
+                 Set-Location <<<<  $path -UseTransaction:$UseTransaction
    + CategoryInfo          : ObjectNotFound: (your-files-here.lnk:String) [Set-Location], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

I tried

ii your-files-here.lnk

But this opens an explorer window instead of changing the current directory.

You may add this to your Microsoft.PowerShell_profile.ps1 file. The cd command will then work as desired.

remove-item alias:cd -force
function cd($target)
{
    if($target.EndsWith(".lnk"))
    {
        $sh = new-object -com wscript.shell
        $fullpath = resolve-path $target
        $targetpath = $sh.CreateShortcut($fullpath).TargetPath
        set-location $targetpath
    }
    else {
        set-location $target
    }
}

Unfortunately, Windows does not make it easy to work with shortcuts. This should work:

$sh = New-Object -COM WScript.Shell
cd $sh.CreateShortcut('your-files-here.lnk').TargetPath

Is the shortcut a necessity?

You could use a Windows link for this. See mklink /? for more information on Windows links/junction points.

Not really an answer to your question, but there is a module you can add to powershell that helps with quicker navigation – called “z”.

Here is more info: https://www.hanselman.com/blog/SpendLessTimeCDingAroundDirectoriesWithThePowerShellZShortcut.aspx

Tagged : / /

Making Game: Change default code page of Windows console to UTF-8

Original Source Link

Currently I’m running Windows 7 x64 and usually I want all console tools to work with UTF-8 rather than with default code page 850.

Running chcp 65001 in the command prompt prior to use of any tools helps but is there any way to set is as default code page?

Update:

Changing HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePageOEMCP value to 65001 appear to make the system unable to boot in my case.

Proposed change of HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutorun to @chcp 65001>nul served just well for my purpose. (thanks to Ole_Brun)

To change the codepage for the console only, do the following:

  1. Start -> Run -> regedit
  2. Go to [HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutorun]
  3. Change the value to @chcp 65001>nul

If Autorun is not present, you can add a New String

Personally, I don’t like changing the registry. This can cause a lot of problems. I created a batch file:

@ECHO OFF
REM change CHCP to UTF-8
CHCP 65001
CLS

I saved at C:WindowsSystem32 as switch.bat.

I created a link for cmd.exe on the Desktop.

In the properties of the cmd shortcut, changed the destination to: C:WindowsSystem32cmd.exe /k switch

Voilá, when I need to type in UTF-8, I use this link.

Browse to this key:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePage

and change OEMCP to 65001. Then restart. With this fix, if you are using
Consolas font, it seems to lock PowerShell into a small font size. cmd.exe
still works fine. As a workaround, you can use Lucida Console, or I switched
to Cascadia Mono:

https://github.com/microsoft/cascadia-code

In the 1809 build of Windows 10 I’ve managed to permanently solve this by going to the system’s Language settings, selecting Administrative language settings, clicking Change system locale... and checking the Beta: Use Unicode UTF-8 for worldwide language support box and then restarting my pc.

This way it applies to all applications, even those ones that I don’t start from a command prompt!
(Which was necessary for me, since I was trying to edit Agda code from Atom.)

This can be done by creating a PowerShell profile and adding the command “chcp 65001 >$null” to it:

PS> Set-ExecutionPolicy RemoteSigned
PS> New-Item -Path $Profile -ItemType file -Force
PS> notepad $Profile

This doesn’t require editing the registry and, unlike editing a shortcut, will work if PowerShell is started in a specific folder using the Windows Explorer context menu.

The command to change the codepage is chcp <codepage>. Example: chcp 1252. You should type it in a Powershell window.
To avoid the hassle of typing it everytime (if you always have to change the codepage), you may append it to the program’s command line. To do so, follow these steps:

  1. Right-click the Powershell icon on Start menu and choose “More” > “Open file Location”.
  2. Right-click the Powershell shortcut and select “Properties”.
  3. Add the following to the end of the “Target” command line: -NoExit -Command "chcp 1252"

Be happy.
Don’t fuss with Windows Registry unless you have no other option.

If you’re using ConEmu then:

  1. Open up Settings from the upper right menu
  2. Go to Startup -> Environment
  3. Add chcp 65001 on a new line.
  4. Click “Save Settings”.
  5. Close ConEmu and re-open it

enter image description here

Tagged : / / /

Making Game: Why is there no option to choose codepage 65001 (UTF-8) as a default codepage in console window?

Original Source Link

I can change codepage 950 (my computer’s default) into codepage 65001 (UTF-8):

chcp 65001

Properties

But why is there no option to choose codepage 65001 as a default codepage in
console?

Default

Is it able to add codepage 65001 as an option?

Several ways, I think

  • Run cmd.exe with shortcut, “cmd.exe /k chcp 65001”.
  • If using emulators like ConEmu or Console – specify the same as startup command.
  • Modify your registry

    [HKCUSoftwareMicrosoftCommand Processor]
    "AutoRun"="chcp 65001"
    

Browse to this key:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePage

and change OEMCP to 65001. Then restart. With this fix, if you are using
Consolas font, it seems to lock PowerShell into a small font size. cmd.exe
still works fine. As a workaround, you can use Lucida Console, or I switched
to Cascadia Mono:

https://github.com/microsoft/cascadia-code

Tagged : /

Linux HowTo: Change default code page of Windows console to UTF-8

Original Source Link

Currently I’m running Windows 7 x64 and usually I want all console tools to work with UTF-8 rather than with default code page 850.

Running chcp 65001 in the command prompt prior to use of any tools helps but is there any way to set is as default code page?

Update:

Changing HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePageOEMCP value to 65001 appear to make the system unable to boot in my case.

Proposed change of HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutorun to @chcp 65001>nul served just well for my purpose. (thanks to Ole_Brun)

To change the codepage for the console only, do the following:

  1. Start -> Run -> regedit
  2. Go to [HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutorun]
  3. Change the value to @chcp 65001>nul

If Autorun is not present, you can add a New String

Personally, I don’t like changing the registry. This can cause a lot of problems. I created a batch file:

@ECHO OFF
REM change CHCP to UTF-8
CHCP 65001
CLS

I saved at C:WindowsSystem32 as switch.bat.

I created a link for cmd.exe on the Desktop.

In the properties of the cmd shortcut, changed the destination to: C:WindowsSystem32cmd.exe /k switch

Voilá, when I need to type in UTF-8, I use this link.

Browse to this key:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePage

and change OEMCP to 65001. Then restart. With this fix, if you are using
Consolas font, it seems to lock PowerShell into a small font size. cmd.exe
still works fine. As a workaround, you can use Lucida Console, or I switched
to Cascadia Mono:

https://github.com/microsoft/cascadia-code

In the 1809 build of Windows 10 I’ve managed to permanently solve this by going to the system’s Language settings, selecting Administrative language settings, clicking Change system locale... and checking the Beta: Use Unicode UTF-8 for worldwide language support box and then restarting my pc.

This way it applies to all applications, even those ones that I don’t start from a command prompt!
(Which was necessary for me, since I was trying to edit Agda code from Atom.)

This can be done by creating a PowerShell profile and adding the command “chcp 65001 >$null” to it:

PS> Set-ExecutionPolicy RemoteSigned
PS> New-Item -Path $Profile -ItemType file -Force
PS> notepad $Profile

This doesn’t require editing the registry and, unlike editing a shortcut, will work if PowerShell is started in a specific folder using the Windows Explorer context menu.

The command to change the codepage is chcp <codepage>. Example: chcp 1252. You should type it in a Powershell window.
To avoid the hassle of typing it everytime (if you always have to change the codepage), you may append it to the program’s command line. To do so, follow these steps:

  1. Right-click the Powershell icon on Start menu and choose “More” > “Open file Location”.
  2. Right-click the Powershell shortcut and select “Properties”.
  3. Add the following to the end of the “Target” command line: -NoExit -Command "chcp 1252"

Be happy.
Don’t fuss with Windows Registry unless you have no other option.

If you’re using ConEmu then:

  1. Open up Settings from the upper right menu
  2. Go to Startup -> Environment
  3. Add chcp 65001 on a new line.
  4. Click “Save Settings”.
  5. Close ConEmu and re-open it

enter image description here

Tagged : / / /

Linux HowTo: Why is there no option to choose codepage 65001 (UTF-8) as a default codepage in console window?

Original Source Link

I can change codepage 950 (my computer’s default) into codepage 65001 (UTF-8):

chcp 65001

Properties

But why is there no option to choose codepage 65001 as a default codepage in
console?

Default

Is it able to add codepage 65001 as an option?

Several ways, I think

  • Run cmd.exe with shortcut, “cmd.exe /k chcp 65001”.
  • If using emulators like ConEmu or Console – specify the same as startup command.
  • Modify your registry

    [HKCUSoftwareMicrosoftCommand Processor]
    "AutoRun"="chcp 65001"
    

Browse to this key:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePage

and change OEMCP to 65001. Then restart. With this fix, if you are using
Consolas font, it seems to lock PowerShell into a small font size. cmd.exe
still works fine. As a workaround, you can use Lucida Console, or I switched
to Cascadia Mono:

https://github.com/microsoft/cascadia-code

Tagged : /

Making Game: Trouble trying to use Windows Search to search for file with a question mark in the content

Original Source Link

It seems that Windows Search is having trouble when I specify a question mark character as the content that I’m searching for within my files.

I’ve tried:

  • content:?
  • content:”?”
  • content:”?”
  • content:?
  • content:%3f
  • content:”%3f”
  • content:3f
  • content:”3f”
  • content:0003F

but each of these yield no results when I do indeed have files that contain ? within the scope of the search. If I instead search for something like content:happy it will indeed find all files with the phrase “happy” within those same files.

My assumption is that Windows Search is treating some characters such as the question mark as a special character likely for the purpose of wild card expressions. To test this theory I’ve also searched for files containing an asterisk * and indeed I have the same issue as when searching for content of question mark. What I’m wondering is whether there is any way to get a search to work where I can search for a literal expression without any type of wildcard matching or at least a way to escape the special characters within the expression.

By the way I’m using Windows 7 Enterprise.

Try ~=? where ? is the character you are searching for.

It looks like Microsoft has removed the ability to search just for special characters. In order to search with special characters there must also be a word included with it (Example: Who?). Again, there must be a word, not just a wildcard, with the special character. That is because Windows Search ignores the special characters with the exception of the wildcards?. Per this indows Search Tips and Tricks page, the only wildcards that available within Windows Search are asterisk and question mark. However, it seems that the only one that works is the asterisk. Even when trying its example, s?n, found on the same page page.

Here is quote from a post on Vista64’s Forums: (Source)

Actually, the problem is a little different. Search is now word-based, not character based. Brackets are considered punctuation by Search, not wild cards. To get meaningful results, queries that contain punctuation must also contain words, a phrase, or a wild card. For example, If I search on this:[*] or this: {*} I get a bunch of files that have a phrase in their file name within brackets, just as I would expect. So give that a try.

In Windows 7 I had a similar problem only I was trying to search for keywords surrounded by square brackets (“[” was also ignored similar to “?”, “(“, “]”, etc.) within the filename. What worked for me is the following:

filename:"*[Cumbia]*" OR filename:"*[Reggae]*"

This would find all my songs which I tagged with the text string [Cumbia] or [Reggae] within the filenames. What I would then do is select all the files and then right click on the selection to invoke the Sendto feature to send all the songs to my music player program (Winamp in this case).

Try content: ~="?" or extension: ~="?" or whatever special character you are looking for in the quotations, etc.

I do not use Windows Search, but I wonder if it supports escape characters as described in this Microsoft article :

Using the search Protocol

If it does, you might try using %3f for the question mark.

Just use powershell to search file contents:

Get-ChildItem -recurse | Select-String -pattern “dummy” | group path | select name

I struggled with finding the “?” character in long lists of filenames. Windows 7 Search is a horrible product I don’t usually use for numerous reasons but I could not get content: or any of the other suggestions to work either. Then I thought of this, problem solved in one minute flat…

Open a normal or elevated command prompt and navigate to the directory in question. Use the following DOS command to create a text file of the directory contents:

dir > files.txt

This will create a text file called files.txt with the directory listing. If you want to list all subdirectories use dir/s > files.txt. If you do this from the root it will list all files on your HD in one big text file.

Now, open the text file in an editor, I used Notepad. Search for the character in question, in this case “?”. Now you can find the names of the offending files.

If there are a lot of files there has to be an easy way to automate this process although I am not thinking of it at the moment.

Finally I used 7-Zip freeware to rename the files. There has to be an automated way to do this too but I haven’t found it yet. I have tried some freeware file managers but none so far let you search for “?” in filenames. At least that way they would all be in a list for easier renaming.

I’ve only found a few resources on the search syntax so I’ll begin to list them here in hopes of finding one that may provide a solution or at least a workaround for my problem.

Windows Search: Tips and Tricks

Windows Search: Advanced Search Options

Tagged : / / /

Linux HowTo: Trouble trying to use Windows Search to search for file with a question mark in the content

Original Source Link

It seems that Windows Search is having trouble when I specify a question mark character as the content that I’m searching for within my files.

I’ve tried:

  • content:?
  • content:”?”
  • content:”?”
  • content:?
  • content:%3f
  • content:”%3f”
  • content:3f
  • content:”3f”
  • content:0003F

but each of these yield no results when I do indeed have files that contain ? within the scope of the search. If I instead search for something like content:happy it will indeed find all files with the phrase “happy” within those same files.

My assumption is that Windows Search is treating some characters such as the question mark as a special character likely for the purpose of wild card expressions. To test this theory I’ve also searched for files containing an asterisk * and indeed I have the same issue as when searching for content of question mark. What I’m wondering is whether there is any way to get a search to work where I can search for a literal expression without any type of wildcard matching or at least a way to escape the special characters within the expression.

By the way I’m using Windows 7 Enterprise.

Try ~=? where ? is the character you are searching for.

It looks like Microsoft has removed the ability to search just for special characters. In order to search with special characters there must also be a word included with it (Example: Who?). Again, there must be a word, not just a wildcard, with the special character. That is because Windows Search ignores the special characters with the exception of the wildcards?. Per this indows Search Tips and Tricks page, the only wildcards that available within Windows Search are asterisk and question mark. However, it seems that the only one that works is the asterisk. Even when trying its example, s?n, found on the same page page.

Here is quote from a post on Vista64’s Forums: (Source)

Actually, the problem is a little different. Search is now word-based, not character based. Brackets are considered punctuation by Search, not wild cards. To get meaningful results, queries that contain punctuation must also contain words, a phrase, or a wild card. For example, If I search on this:[*] or this: {*} I get a bunch of files that have a phrase in their file name within brackets, just as I would expect. So give that a try.

In Windows 7 I had a similar problem only I was trying to search for keywords surrounded by square brackets (“[” was also ignored similar to “?”, “(“, “]”, etc.) within the filename. What worked for me is the following:

filename:"*[Cumbia]*" OR filename:"*[Reggae]*"

This would find all my songs which I tagged with the text string [Cumbia] or [Reggae] within the filenames. What I would then do is select all the files and then right click on the selection to invoke the Sendto feature to send all the songs to my music player program (Winamp in this case).

Try content: ~="?" or extension: ~="?" or whatever special character you are looking for in the quotations, etc.

I do not use Windows Search, but I wonder if it supports escape characters as described in this Microsoft article :

Using the search Protocol

If it does, you might try using %3f for the question mark.

Just use powershell to search file contents:

Get-ChildItem -recurse | Select-String -pattern “dummy” | group path | select name

I struggled with finding the “?” character in long lists of filenames. Windows 7 Search is a horrible product I don’t usually use for numerous reasons but I could not get content: or any of the other suggestions to work either. Then I thought of this, problem solved in one minute flat…

Open a normal or elevated command prompt and navigate to the directory in question. Use the following DOS command to create a text file of the directory contents:

dir > files.txt

This will create a text file called files.txt with the directory listing. If you want to list all subdirectories use dir/s > files.txt. If you do this from the root it will list all files on your HD in one big text file.

Now, open the text file in an editor, I used Notepad. Search for the character in question, in this case “?”. Now you can find the names of the offending files.

If there are a lot of files there has to be an easy way to automate this process although I am not thinking of it at the moment.

Finally I used 7-Zip freeware to rename the files. There has to be an automated way to do this too but I haven’t found it yet. I have tried some freeware file managers but none so far let you search for “?” in filenames. At least that way they would all be in a list for easier renaming.

I’ve only found a few resources on the search syntax so I’ll begin to list them here in hopes of finding one that may provide a solution or at least a workaround for my problem.

Windows Search: Tips and Tricks

Windows Search: Advanced Search Options

Tagged : / / /

Making Game: How do I clear the cache / history in Windows 7?

Original Source Link

In Windows XP there was an option off the task bar properties to clear all recently accessed webpages, recent file lists, ie. cache, temp files and so on; is there an equivalent for Windows 7?

  1. Right-click on the taskbar or the Windows Orb.
  2. Open “Properties”.
  3. On the “Start Menu” tab, click on “Customize…”.
  4. In the “Customize Start Menu” windows, check the checkbox “Recent Items”.
  5. Click OK twice to close the 2 open windows.
  6. In the Start Menu, you have now a “Recent Items” entry.
  7. If you right-click it, you have a menu option “Clear recent items list”.

    alt text

Tagged : / /