Solved

How to enable "Open With" on file?

Posted on 2016-08-02
19
78 Views
Last Modified: 2016-08-28
I am trying to block .js files from being run on a workstation. Following some web instructions I found, I have created a dummy .js file. The instructions say to right-click on the file, select "open with" and select notepad.

I've done this on a couple of workstations so far, but on this one, I can create/save the .js, I can run the .js (no warning about dangerous file like on the other workstations), but when I try "open with" I get the message, "Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item." The location in this case is the desktop. I've also tried moving it to C:\. The user is a local Administrator.

How can I fix this?
0
Comment
Question by:jmarkfoley
  • 7
  • 7
  • 3
  • +2
19 Comments
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 41740053
Hmmm.

did you compare permissions for the file on this station versus the other stations?

right-click file, properties, security tab, advanced brings up window...

"Advanced Security Settings for filename"

Check everything there for differences.  See if owner makes sense.



You might also check owner in this same window for the Desktop folder you're in.



Any use of virtual machines there?
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 41740160
Some rather interesting results. The 1st image (properties) shows the Properties > Security for the user that does not work (left) and user that does (right).

2nd image shows the Advanced button for each user. Of note, the not-working user shows 'Inherited From' set to "<not inherited>", and shows "C:\Users\doris.HPRS\" for other in the list. The working user shows 'Inherited From', "Parent Object".

3rd image (owner) show the respective owners of these files.

4th image (effPermissions) show the Effective Permissions Tab. Both users show full control.

One very interesting bit is that the working user's Object name is \\mail.hprs.local\Users\renee\Desktop\disableme.js whereas the non-working user's Obhect name is C:\Users\doris.HPRS\Desktop\disableme.js.

This is telling me that the non-working user's desktop is NOT in redirected folders, so I have bigger problems than just file permission issues.
properties.jpg
advanced.jpg
owner.jpg
effPermissions.jpg
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 41740346
js-handler.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.js]
@="JSFile"

[HKEY_CLASSES_ROOT\.js\OpenWithProgids]
"Notepad"=""

[HKEY_CLASSES_ROOT\.js\OpenWithProgids\Shared]
@="Shared key to keep this from being removed with install/uninstall of side-by-side components."

[HKEY_CLASSES_ROOT\.js\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

Open in new window

0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 41740888
That's cool Dave!!  Didn't know we could do that.

For rookies like me I looked it up and wanted to include this example stuff since I had no clue about creating and using .reg files on as as-needed basis.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724873(v=vs.85).aspx

and

https://support.microsoft.com/en-us/kb/310516


And wanted to mention about the path in Renee's object name.  It appears it is merely a UNC path for the net as described here.

http://compnetworking.about.com/od/windowsnetworking/g/unc-name.htm
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 41745781
I created an ran that .reg file and rebooted, but it didn't work. It still tried to open my .js file with jscript.

As to the UNC path, yes -- I didn't complete my thought in my post. All computers should be \\mail.hprs.local\Users\user\Desktop\. The fact that the troublesome workstation is C:\ indicates that this one is not using redirected folders. No sure what to do about that. Perhaps un-join and re-join the domain? My problem would likely go away if the Desktop was properly redirected.
0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 41746637
I think you're probably right.
Maybe it will be evident if you look at more info.  Maybe there is no share on the server for Doris, or maybe it is customized.

Computer Management, shared folders, shares, properties


If using File Explorer, you can go to network and right click on any shared folder and properties will show the UNC network path.



All this described here.

http://www.digitalcitizen.life/how-view-list-all-shared-network-folders?page=1



Command prompt helpful too.  enter

net share

 and it will show if share is assigned to a folder on the server.  Here is the details of net share.

https://technet.microsoft.com/en-us/library/bb490712.aspx




Also, if you enter...

net use

it will show connections.  There are parameters you could look into for net use here.

https://technet.microsoft.com/en-us/library/bb490717.aspx?f=255&MSPPError=-2147217396
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 41749604
I've fiddled around with the AD settings and now I can save the file to \\mail.hprs.local\Users\doris\Desktop\disable.js. However, this did not solve my problem. when I try to "open with" I still get the message:
Windows cannot accessHowever, if I rename this file to disableme.txt (same content), I can do open with. So, there must be something about the .js file type itself that is preventing me from doing "open with" on this file.

Ideas?
0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 41749837
Hmm.  Your box says "Network Error" and clearly that it is a permissions problem.  Please look again at security tab, owners, and effective permissions for Renee and Doris.  And are you doing this as Doris or admin?  Now with AD changes, do renee and doris appear the same?  Does doris now have domain admin user?

Here is a good starting point from Microsoft.  Various causes of this type of error and the associated steps to remedy for each situation.
https://support.microsoft.com/en-us/kb/2669244

Sometimes my permissions problems are due to inherited permissions.  Inherited from folders higher in the tree structure.  In your earlier posts renee's was inherited and doris' was not.  Maybe java needs to be updated or uninstalled and installed again for doris' workstation or for the server in how it deals with doris.  Maybe a java component needs to be available and isn't due to corruption, missing browser add-on, or add-on update, etc.  But we have to focus on the fact it's a network error.  If everyone's desktop is on the server, maybe the java component on the server needs to include doris?


Here is a thread about someone trying to get rid of what appeared to be java malware.  It was a root kit taken care of by TDSS Killer from Kaspersky.  Links are there.
http://answers.microsoft.com/en-us/protect/forum/mse-protect_scanning/how-do-i-find-and-remove-a-javascript-virus/698c2f2c-1fa3-4011-8674-aca04cf2cb79

Here is an explanation about problems with Windows UAC causing permissions errors.
http://www.think-like-a-computer.com/2011/05/11/windows-access-denied-folder-administrator/

Tomorrow I'll see if I can help round up a more appropriate expert.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 41749848
Microsoft keeps me in a constant state of confusion. Indeed, I get the error shown in my previous message if I right-click and select Open With > Choose Default program. However, when right-clicking and selecting 'Properties', in order to investigate based on your latest message, I notices an "Opens with" Change button. So I clicked it and, lo and behold, I was able to select Notepad! (see image). Now, even as a .txt file, I still get the error with "Open With > Choose Default program", but can change it at will via the properties > Change button. Is there an explanation?

Notice (in the image) that I am still on the AD redirected folder: \\mail.hprs.local\Users\doris\Desktop.

Notice (in the image) that there is no Security tab -- as there are in the images I posted in ID: 41740160. It there an explanation?
jsProperties.jpg
0
Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 41750553
does this video on putting in the security tab do it?

https://www.youtube.com/watch?v=T4ehnK6ZjFs
0
 
LVL 9

Expert Comment

by:Christopher Jay Wolff
ID: 41750600
I think you should investigate this huge amount of material on UAC also.

https://www.youtube.com/watch?v=9t7HtG_wmkE




Also, I typed in "UAC and security" into the EE search box and had a bunch of results.  For instance...

https://www.experts-exchange.com/questions/28907419/Strict-Volume-Permissions-on-Windows-When-UAC-is-Enabled.html
Please click on and read McKnife's reference.
0
 
LVL 42

Expert Comment

by:Davis McCarn
ID: 41751257
You guys are way down this path; but, did anyone notice that Doris is not joined to the domain?  The first image posted shows radically different characteristics with Doris getting her permissions from her own local PC and Renee getting hers from the domain controller.
1
 
LVL 69

Expert Comment

by:Merete
ID: 41751343
java scripts can also be controlled by internet explorer with windows.
try disabling it there as well.
Enable or Disable JavaScript in Internet Explorer 11
http://www.technipages.com/internet-explorer-enabledisable-javascript
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 41751520
Christopher Jay Wolff: I haven't looked at the video yet, but will do so tomorrow as that may resolve my question on why the Security tab is missing. I have been exploring the UAC thing. I haven't messed with UAC on Doris' computer because her setting is the same as all the other workstations that had no problem with the "Open with" mechanism -- still trying to determine what is different.

Davis McCarn:
did anyone notice that Doris is not joined to the domain?
Initially true, but if you look at the image in my posting ID: 41749848, her desktop now shows \\mail.hprs.local\Users\doris\Desktop, so I think I have that one partial fixed (still some issues which I am dealing with in a separate question: https://www.experts-exchange.com/questions/28962441/How-to-get-folder-redirection-working.html.

Merete:
java scripts can also be controlled by internet explorer with windows.
These workstations are using Firefox, but in any case I'm not sure about disabling javascript per se. Our local web applications pretty much all have javascript and javascript in the actual webpages I don't think is a problem. The problem is with downloaded .js files run by Windows Jscript which, as I understand it, has javascript extension that permit updating of the file system -- normal webpage embedded javascript cannot do that.
0
 
LVL 42

Expert Comment

by:Davis McCarn
ID: 41751928
So now her login screen specifically has her logging into mail.hprs.local\doris or clearly says she is logging into the domain?
If it doesn't, none of the GPO's (like folder redirection and permissions) are being applied.
0
 
LVL 1

Accepted Solution

by:
jmarkfoley earned 0 total points
ID: 41757365
Davis McCarn:
So now her login screen specifically has her logging into mail.hprs.local\doris or clearly says she is logging into the domain?
Yes, actually she was always logging into the domain, only her Desktop was not redirected (Documents, Videos, etc. were). The problem was that redirection/sync was broken as explained here: https://community.spiceworks.com/topic/289832-folder-redirection-sync-breaking-on-many-machines. I was able to fix her Desktop redirection by resetting the CSC database as explained in that link, and in the EE question I referenced in my previous post.

Having said all that, I still cannot right-click > Open WIth > Choose Default Program, on this .js file, although the Security Tab is back.

Furthermore, I can do the "Choose Default Program" with NONE of the files on her desktop, including Word, Excel and PDF. As with the .js file of this topic, I can do right-click > Properties > General > "Opens with" Change button, for all these files. On other workstations' desktops none of this is a problem.

Since I have a workaround, unless someone can offer a relatively painless way to fix the "Choose Default Program" issue I'm have on this workstation alone, I'm going to not lavish more time on this issue and call it resolved.
0
 
LVL 42

Assisted Solution

by:Davis McCarn
Davis McCarn earned 200 total points
ID: 41757660
Save this as Add-Open-With-Back.reg and then merge it:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Open With]
@="{09799AFB-AD67-11d1-ABCD-00C04FC30936}"

[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Open With EncryptionMenu]
@="{A470F8CF-A1E8-4f65-8335-227475AA5C46}"

You'd need to reboot afterwards; but, if that doesn't put the Open With context menu back, the PC or her login has permissions issues (period).
0
 
LVL 9

Assisted Solution

by:Christopher Jay Wolff
Christopher Jay Wolff earned 300 total points
ID: 41758038
Here is a Windows 7 step by step and some downloadable default values for different file types.
http://www.sevenforums.com/tutorials/19449-default-file-type-associations-restore.html

In this following Windows 8.1 link, the author's main two follow on links are dead but the article reminds us to use the control panel to have defaults associations restored.  We've probably all done this but I had forgotten after not doing it for a couple years.
http://answers.microsoft.com/en-us/windows/wiki/windows8_1-desktop/windows-81-how-to-set-and-restore-file/16c2e10d-ec99-4fee-8f56-b87c4338e006

I would certainly use a registry cleaner when done with all this, like one Davis recommended for me called CCleaner

CCleaner.
http://www.piriform.com/ccleaner
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 41773568
I've not pursued the additional suggested solutions since I was able to get it done via the alternate path described in my accepted solution post.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now