File appears in windows explorer but not in open box - windows

I have a box running Windows Server 2008 R2.
If I look at a certain directory with Windows Explorer -- c:\windows\system32\inetsrv\config -- I see 2 subdirectories and 3 files.
Then I go into a program and use an open box to open a file. I navigate to that directory. I can see the 2 subdirectories, but no files appear. If I type in the name of the file (applicationHost.cofnig), it says that it does not exist.
I've tried this with Notepad++, Wordpad, and Filezilla Client. The filter is set to ..
What's really killing me is that I'm trying to open this file from within a VB program, and it's saying not found.
Oh, and here's a kicker: If I access the file with a UNC name, then it works. That is, trying to open "c:\windows\system32\inetsrv\config\applicationhost.config" gives a not-found. But if I write "\server1\c$\windows\system32\inetsrv\config\applicationhost.config", then it works. If I change my VB program to use a UNC name, it works. So I suppose I have a work-around, but I'd really like to understand what's going on.
If instead of logging into the server, I run Notepad++ on my desktop, and enter \server1\c$ and then navigate from there, all three files show up.
Oh, and also, if in Windows Explorer I right-click the file and select "edit with notepad++", it opens. But from within Notepad++, trying to use the open box doesn't work. I tried navigating through the directory tree, and I tried just typing in the full path. Either way, "not found".
I checked my permissions and it says I have "full access" to the directory and to the file.

Related

equivalent of "Go to Folder window" in windows, to access a file in a windows open prompt located somewhere else from the current directory?

I am used on OSX to use CMD-Shift-g to open a Go to Folder window. What fundamentally does, is to open a file in a location without me using the mouse to navigate to a different directory. I paste the path of a file, like if I am loading a PSD in Photoshop, and I can load the file, independently from where my current directory is pointing at.
Is there an equivalent to this in Windows? Like if I have a file open prompt in Photoshop (or any other windows app, for what matters), that is pointing at my desktop, while my file is in some other location, and I can pass the full path of the file, like I do on OSX with the go to folder window?
I found a "workaround". Windows fundamentally accept in the file name textfield, the full path too; so if you are on desktop for example, and in the file name field you type the full path of the file, it will in fact change the current directory to the full path you pass.
Works in a similar way but without the need to call a window to just change the path.

.srt file types doesn't exist under 'Choose default apps by file type' after after formatting windows 10, what to do?

Before I did a clean install of my desktop with windows 10 I had .srt to open by default in Sublime Text after I have formatted my computer I somehow miss the file format .srt under 'Choose default apps by file type'.
The .srt should be be between the .srf and .srw file types, but it isn't (as shown in the image here: https://answers.microsoft.com/en-us/windows/forum/windows_10-desktop-winpc/srt-files-back-to-unknown-application/e33cace8-dd59-4557-9631-e8e82a8307b3?auth=1).
If I try "open with and find Sublime (or any other software for that matter, it will open it, but it will not set it as the default program even though I checked the box) and will still appear as an unknown filetype....
If I go into properties and try to change the "open with" from there, it will just keep showing "choose a program" even still.
tried updating the computer and restart it and frankly I've given up, and it doesn't seem anyone have run into this problem before of missing a filetype under 'Choose default apps by file type'.
I also tried
1) Settings - Indexing Options
2) Advanced button
3) File Types tab
4) Add New Extension to List box, type in extension (without a period) such as "py"
5) Click Add, OK and Close
and while the format does appear in the 'Choose default apps by file type', it still doesn't let me change it at all...
Anyone got an answer to this problem?
I have now tried to go into regedit and use "search" on anything that included "sublime" and ".srt" and deleted them all... restarted the computer, reinstall sublime. The file extension I created myself in the indexing option, has been deleted.
Sublime can still open the file, but if you try to make it default program by simply opening it or or going into the files properties and do it that way, it will just open the file without it making it the default program as it should.
going into the indexing option and create the .srt extension format so it can be found under 'Choose default apps by file type' will allow you to choose notepad or wordpad as default program. When I choose either of them, the will just freeze for 1-2 sec and then nothing has changed and the extension havn't been associated with any of the programs.
I tried following the following links, and nothing has worked. Guess I'll just have to accept there is no solution rather than to live with out until I reform my PC again, cause it works without a problem on my laptop and I formatted them both the same time and installed the exact same things on both and the exact same way s:
I've tried to use the following links for help, but to no avail since non of the things I have tried have fixed it.
https://superuser.com/questions/655600/i-cant-set-a-program-as-the-default-to-open-a-filetype-with-in-windows-7
https://superuser.com/questions/91655/open-with-dialog-ignores-my-selection
https://superuser.com/questions/13653/how-to-set-the-default-program-for-opening-files-without-an-extension-in-windows
Windows 7 file extension association
One way to get an empty .srt entry back in the 'Choose default apps by file type' control panel is to create a new key for .srt in your registry under HKEY_CLASSES_ROOT:
Open Registry Editor, e.g. by typing 'regedit' into the start menu or a command prompt
At the top of the tree, right-click on 'HKEY_CLASSES_ROOT', New -> Key
Rename the new key to '.srt' and press enter to save

Open folder on portable device with batch file

General goal: create a desktop shortcut to a folder buried the file structure of my phone's SD card (connected via USB). Note, this is on a work computer, so I can't do anything to crazy.
I tried using normal shortcuts to no avail, so I decided to try using a batch if I can't use a shortcut. If using a shortcut is possible or there is a better option than a batch let me know.
Specific question: How can I open a folder using a batch file? I can manually open explorer, paste the address into the bar and go there, so there should be a way to mimic this, but so far my attempts have been unsuccessful.
Attempts:
%SystemRoot%\explorer.exe "Computer\My S4\Phone\Android\data\com.dropbox.android\files\scratch\"
explorer Computer/My S4/Phone/Android/data/com.dropbox.android/files/scratch
start "" "Computer\My S4\Phone\Android\data\com.dropbox.android\files\scratch\"
start Computer\My S4\Phone\Android\data\com.dropbox.android\files\scratch
This is an addition to Andry's answer:
It can be very complicated to get the whole path to an MTP folder like
::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_03de&pid_21e7&mi_00#6&a5ebb37&1&0000#{6ac27878-a6fc-2155-ea85-f98f491d4f33}\{E4FC4EA5-FFFF-FFFF-0000-000000000000}
To get the path do the following:
In Windows Explorer select the folder on the MTP device you want to get the path of.
Open it's context menu and select Copy
Open in Explorer a folder on your PC, open the context menu on a free area and select Paste Shortcut
Now we need a too that can read .lnk files. I have used the tool LECmd. Execute LECmd.exe -f <path to the .lnk file created in step 3>.
You will get a lot of content printed to the console. The interesting part is the Parsing Path next to the end.
In my case it was ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_03de&pid_21e7&mi_00#6&a5ebb37&1&0000#{6ac27878-a6fc-2155-ea85-f98f491d4f33}\SID-{10001,,21003612160}\{E4FC4EA5-FFFF-FFFF-0000-000000000000}
Now we are close, unfortunately the path shown above can not be used because it contains an invalid part: \SID-{10001,,21003612160}. Remove that part and you can open the explorer in that MTP folder using
start "" "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_03de&pid_21e7&mi_00#6&a5ebb37&1&0000#{6ac27878-a6fc-2155-ea85-f98f491d4f33}\{E4FC4EA5-FFFF-FFFF-0000-000000000000}"
There is a way to open an MTP device folder directly in the Windows Explorer window on Windows 7 x64.
Here is steps:
Open Windows Explorer with the My Computer folder, for example:
start "" "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
start "" "shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
explorer "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
explorer "shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
The complete list of GUIDs you can find on the internet, for example: https://www.tenforums.com/tutorials/3123-clsid-key-guid-shortcuts-list-windows-10-a.html
Attach the MTP device and enable File Transfer mode in the device. It must be shown in the My Computer window as a portable device entry.
Drag and Drop the MTP device entry icon to the Desktop.
Open any notepad, for the instance, Windows notepad: Win+R -> notepad
Drag and drop the desktop icon into notepad window.
At the end of the notepad text would be something like:
::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_0e8d&pid_201d&mi_00#7&1084e14&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33} (spaces removed).
You can cleanup the spaces between characters by copy the string into another instance of the notepad and replace them through the Ctrl+H to nothing.
Now you can open the MTP device folder directly:
start "" "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_0e8d&pid_201d&mi_00#7&1084e14&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\<your-local-path-to-folder>"
There is a wait timeout, so the Windows Explorer window might not open immediately.
To generate a shortcut to target folder you can use make_shortcut.vbs script from here: https://github.com/andry81/contools/tree/HEAD/Scripts/Tools/ToolAdaptors/vbs/
For example:
>
make_shortcut.vbs myphonecamera.lnk "shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_0e8d&pid_201d&mi_00#7&1084e14&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SD-card Samsung\DCIM\Camera
Now you can click myphonecamera.lnk to open the folder or use the Windows Explorer:
>
explorer myphonecamera.lnk
Instead of using Computer which is not a device name, try to use \\?\ or \\.\ which both refer to the local computer.

Having problems running a batch script from windows shell command

I'm in over my head. This is for my company who just laid off everyone that used to do this.
Quick summary: I have modified the registry so when you right click a folder, you get the option "Folder_To_PDF" and the data for the regedit is merge1.bat "%1" which runs a batch file that is located in C:\Windows
Problem: Click on "Folder to PDF" and it appears the cmd.exe opens for a brief second, then disappears but never actually executes. (It is supposed to open Ghostscript then do the folder to PDF)
What I've done: I have successfully made the batch file work by moving it from C:\Windows to the folder itself, where you can run the batch file and it opens Ghostscript fine. So I know it's not the batch file or Ghostscript setup. I think the problem is either 1) this is a corporate computer with corporate security, maybe not allowing it to run as admin? (I am an Admin by sheer lack of options) Or, the folder to pdf button does not know where to find the batch file, but I've already created a PATH in the environment variables.

Can't edit the host file

I've been trying to edit my host file for a while now and I keep failing.
I tried to open notepad as administrator and then click File --> Open and choosing the host file but I get this error message:
hosts
You don't have permission to open this file.
Contact the file owner or an administrator to obtain permission.
I tried notepad++ as well (as administrator) but I couldn't even get to the file with it (it doesn't show the etc folder in drivers).
I also tried to check my "User Account Control Settings" but it was already on the lowest level (never notify).
While looking online for a solution I've noticed more people having the same problem but I couldn't find a solution that worked for me.
I'm running Windows 7 Home Premium 64-bit
You have to run notepad++ (or your favorite text editor) as an administrator. Right click notepad++ and it should display an option to run it as admin. Once open, locate the hosts file and open it with notepad++.
Windows hosts file location: c:\windows\system32\drivers\etc
Note: copy and paste the above url in the file-explorer when opening a file within notepad++ instead of locating it manually as some directories are hidden.
If the above doesn't work, Windows 10, 8 sometimes requires you to first turn off your antivirus.
If you require editing the hosts file often, you could look into third-party freeware tools to aid you. [1][2]
This works:
For Windows 7 and Windows Vista
Click Start -> All Programs -> Accessories.
Right click on Notepad and select Run as administrator.
Click Continue on the "Windows needs your permission" UAC window.
When Notepad opens Click File -> Open.
In the filename field type the file location, i.e.:
C:\Windows\System32\Drivers\etc\hosts
Click Open.
Make the necessary changes to the hosts file.
Click File -> Save to save your changes.
In my case I could open the file (and Notepad++ was running as admin) however I could not edit it: I could neither type some text, nor delete anything - no popups, no warnings - it looked like keyboard is not working.
I copied the hosts file in the same location, deleted the original hosts file and renamed the new one to hosts. After that I was able to edit the file. I am guessing this should be some permission issue.
OS - windows 7
But first of all you have to do temporally disable your virus guard.
Dissable your antivirus and open notepad.exe with run as administrator edit your host file and save this.
'Run as admin' not enough in windows 8. Set 'modify' access also not enough if you have antivirus
So you need
1) Disable antivirus
2) Set 'modify' access for all applications
3) Modify 'hosts' file
4) Revert 1-2 steps
OK I got it! I had to right click the file, go to Properties, Security tab and click Edit.
Then I took ownership for the file and I had the ability to edit the file's permissions.
On windows 8 running notepad as administrator wasn't enough for me to edit this file. When I tried to open the file from within an administrator session of notepad the etc directory was empty. I changing explorer to show hidden files and extensions, but that only helped in explorer. To edit this with notepad I needed to modify the security settings on the file so that all users and all applications could write to the file. After I finished my changes I set the file back to read only and execute for all applications and users.
there are two notepad.exe in x64 windows,
you must use full path c:\windows\system2\notepad.exe ,this one is 64 bit version,
only type notepad whithout path may be launch 32 bit notepad.
(c:\windows\syswow64\notepad.exe)
"Run as administrator" just let you enforce launch 64 bit notepad.exe
using 32 bit software to edit c:\windows\system32\drivers\etc\hosts
the x64 system will automatic redirect to c:\windows\syswow64\drivers\etc
and there is no hosts file.
the GUI stiil display current folder is c:\windows\system32
but the real folder is c:\windows\syswow64
I had the same problem. After opening the notepad as an Administrator and editing hosts file, I could not save it (denied access). I could not even change file's permissions. What worked for me was copying the file elsewhere, editing there, and then overwriting the original through Command Prompt opened as Administrator. I didn't have to turn off antivirus program.
To open the Command Prompt as administrator, press windows+X and select that option from the menu.
Than, type: mv path-to-the-copy-of-hosts-file\hosts c:\windows\system32\drivers\etc\hosts
I just needed to uncheck "read only" property to allow modify that file.

Resources