Turn off change file extension warning in Windows 7

75

21

Is there a way to turn off the file extension rename dialog in Windows 7?

The one that prompts you

Rename: If you change a filename extension, the file might become unusable. Are you sure you want to change it?

Simon

Posted 2009-11-08T10:20:45.937

Reputation: 1 957

4

If, like me, you often get this warning when creating a file of a certain type (ie. creating a new "Text Document" and renaming) then you could add the desired type to the "New" context menu instead.

– MrWhite – 2013-11-01T11:31:16.607

Answers

9

It's possible with an AutoHotkey script:

While, 1
{
 WinWait, Rename ahk_class #32770
 WinActivate, 
 ControlClick, Button1
}

Install AutoHotkey, save the code above in a file with the .ahk extension and launch the script. It will wait for the Rename window to appear. When it does, it automatically "clicks" on the Yes button (identified here with "Button1").

If you don't want to install AutoHotkey, here is a compiled version of the same script. Run the executable and watch it do its magic :-) .

Note it does not really answer the question, as the question still appears. But it's automated so you'll not be bothered by it anymore.

Snark

Posted 2009-11-08T10:20:45.937

Reputation: 30 147

2This class #32770 is very common for many types of windows (try search for it), so this script will do something with many types of windows titled "Rename". That is, you might be getting more help than you bargained for :) – Evgeni Sergeev – 2015-05-27T00:56:42.247

This solution doesn’t stop the annoying sound that plays when the dialog pops up, which if you need to rename numerous files, gets very annoying. You would have to remove the sound from the system sounds list (and put it back afterwards), which is just too much work for something that should be configurable. :-( – Synetech – 2017-06-03T15:54:10.273

this script presumes the window is the one it is expecting, not some other error or prompt. AFAIK, one can query for the existence of the proper window (such as via title) prior to clicking. – horatio – 2012-03-16T19:57:44.217

4I tried this, but it still takes several seconds for the script to respond and "click" yes. Is there some way to alleviate this? – Cecil Has a Name – 2009-11-27T21:42:18.343

This is a workaround. Is there no other way? Seeing the extensions and change them. I'm a SuperUser and know what I'm doing... ;-) – FiveO – 2013-10-24T07:12:46.747

21

In response to a comment about the accepted answer, I also found the AHK script to be quite slow. This modification seems to make it faster:

While, 1
{
 WinWaitActive, Renommer ahk_class #32770
 send o
}

You'll notice I'm using windows in french. For english use:

While, 1
{
 WinWaitActive, Rename ahk_class #32770
 send y
}

For windows in portuguese (at least the pt-BR version), use:

While, 1
{
 WinWaitActive, Renomear ahk_class #32770
 send s
}

LiamHanks

Posted 2009-11-08T10:20:45.937

Reputation: 319

2Brilliant. This works ALLOT faster than the accepted answer! Like 0.1s vs 0.5s probably – Jonny – 2014-11-25T14:27:41.863

1It still dings every time. – Synetech – 2017-06-03T15:54:28.807

9

It is very much possible, with the right tools, patience, and nice disassembler and some luck you can disable it.

However, it is not as simple as changing a registry key.

Here is an example of someone disabling the "delay" when you try to delete a file that is in use. http://www.codeproject.com/KB/system/NoDeleteDelay.aspx
I just tried to poke around and didn't find anything useful.

I think a better solution than RtvReco is for someone to create a menu option to the context menu that says like "Rename2" and pops up a messagebox prompting for the new filename and uses Windows API to rename it.

Natalie Adams

Posted 2009-11-08T10:20:45.937

Reputation: 2 071

(I still use Explorer, but I use Clover which embeds Explorer windows in a Chromium frame to provide tabbed windows to Explorer. NB: use the old 3.0.406.0 version, not the newer ones that are bad, ad-y, and suspicious. Also, I'm sticking with Windows 7 for the foreseeable future because I've tested Windows 10 and it's horrible. So, I don't know what changes Microsoft has made to Explorer since then—though I doubt they'll get around to adding conveniences like tabbed Explorer windows. ¬_¬)

– Synetech – 2020-02-21T18:01:40.433

1Actually, I incorporated the NoDeleteDelay into my all-purpose Explorer hack a few years ago. It looks like adding a Rename no-prompt to it is next on the list. :-) – Synetech – 2012-03-16T18:53:15.957

@Synetech: some more information about your "all-purpose Explorer hack" would be much appreciated. – Coxy – 2012-05-21T05:34:56.253

1@Coxy, it’s just a program that patches explorer.exe to fix/improve/delete a bunch of things that annoy me about the default one. – Synetech – 2012-05-21T14:01:01.917

1@Synetech: oh yes, I understood that but I was wondering whether you had a github/codeplex/geocities page where I could take a look and fix my own explorer in the same way. – Coxy – 2012-05-22T00:08:45.127

Someone has to play devils advocate and I would have to urge not to patch explorer.exe - especially since an update may overwrite your patch...or even worse the code of explorer changes. If you don't want the popup, then use a different file manager. – Natalie Adams – 2012-05-22T02:11:53.823

1Yes, obviously things can go wrong if you patch files willy-nilly, and obviously it has to be re-applied after updates. As for a different file manager, I have yet to use one that I like over Explorer; they all tend to be too cluttered and overloaded. Besides, the rename prompt is the only annoying (yet fixable, albeit through force) thing about Explorer. – Synetech – 2012-05-22T14:28:36.707

3

You cannot disable the file extension warning message. It has this design to ensure the user's safety from modifying the files accidentally.

Source:

Microsoft Community Answer

r0ca

Posted 2009-11-08T10:20:45.937

Reputation: 5 474

30A superuser knows what he's doing (hopefully) - I never renamed a file extension "accidentally". And if so - I don't think Windows will throw a bluescreen right after the accidentally rename... – FiveO – 2014-07-02T13:54:22.793

I totally agree with SU community but this site is a world wide reference and some people, less tech-savy than some over here might try to rename and mess up the system. Nevertheless, this is a Microsoft limitation so at that point, techy or not, it is what it is. (As per the source of course) – r0ca – 2014-07-02T14:10:44.243

2You cannot disable the file extension warning message. It has this design to ensure the user's safety from modifying the files accidentally. Microsoft is almost as bad as Google, deciding for users what is best for them instead of defaulting to safe for novices but allowing advanced users to override by choice. – Synetech – 2017-06-03T15:57:38.170

3

Rather than download an app, why not just use the 'ren *.aa *.bb' command in cmd (command prompt)?

Helpful

Posted 2009-11-08T10:20:45.937

Reputation: 39

3It isn't DOS, but this answer is more helpful than the others. – NateS – 2014-10-11T09:11:34.130

2Not really. At best, it is only useful if you need to rename one or two files, and even then, the extra time required to open a command-prompt and rename the correct files is more than the time required to click Yes in the dialog that Explorer pops up. – Synetech – 2017-06-03T16:00:19.407

3The command prompt in Windows 7 isn't DOS. – Michael Frank – 2014-05-02T07:31:39.710

2

you can't, however, all is not lost.

you can use RtvReco to automatically close the warning as soon as it appears. this nifty little tool is designed to automate many aspects of Windows, by pressing buttons in annoying dialog boxes, choosing menu items, maximising, and minimising windows for you.

... or use a decent file mananger instead of Windows Explorer (e.g. Total Commander).

both programs are shareware, try before you buy.

i am aware of this registry hack, however, it does not work for me with Windows 7

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

set the value of ConsentPromptBehaviorAdmin to zero (0) and Reboot.

p.s.: of course there are free alternatives to Total Commander, it just so happens to be my file manager of choice.

Molly7244

Posted 2009-11-08T10:20:45.937

Reputation:

3I am under the belief that just disables UAC, can someone else verify/deny? – Natalie Adams – 2009-11-08T19:20:28.973

yep, but i found this in a thread at MSDN as a possible solution to the very same annoyance, but it doesn't work. – None – 2009-11-08T19:39:15.020

1

Here is the code I used to solve the issue in AutoIT script. The only issue is that is keeps running and hogs some resources. Unless yall have a better idea to fix the script. :-)

While 1
  if WinActive("Rename","") Then
    Send("!y")
  EndIf
  WEnd

Mike

Posted 2009-11-08T10:20:45.937

Reputation: 11

1

As we have files that when downloaded automatically has the date and time added as the extension. So I have been looking for a solution and found one.

Download a program called Free Commander. They have a portable version that can be installed on a USB thumb drive if needed.

This program allows you to select multiple files as in my case, and renames the extension without asking are you sure.

Glenn

Posted 2009-11-08T10:20:45.937

Reputation: 11

0

I was also quite tired of this stupid message so I've made my own Autohotkey Script, with some new ideas.

I didn't want a permanent settimer or the "while" command eating resources all the time. Since I always use F2 for renaming files, I've made a hotkey to add a special function to this key. Thus, the timer is only triggered when pressing this key, and goes off when the task is complete.

I've also considered that I only want my script to affect this particular dialogue box. Taking into account the name alone was not enough, because the same rename dialogue appears when you try to rename an item in the start menu, for instance.

So, there are some conditions for this function to work. First, it will operate on Explorer windows and on the Windows desktop. With the rest of the programs or environments, F2 will continue working normally. Also, to prevent conflicts such as the aformentioned, the script checks the width and height of the rename dialogue window so as to verify that it's a match.

Finally, I've also included the feature of autoselecting the whole file name (together with the extension, like before Windows 7), because I prefer it this way. Feel free to remove the line Send ^+{end} if you don't want it.

For English versions of Windows, you will have to change "cambiar nombre" to whatever is on the title of your rename dialogue window. Also, change the "s" with a "y". In case it doesn't work, you can also use Autoit3 Window Spy to check out that your rename dialogue window actually has this size (if (warnw = 515) and (warnh=154).

#SingleInstance force

GroupAdd, folders2, ahk_class CabinetWClass
GroupAdd, folders2, ahk_class WorkerW
GroupAdd, folders2, ahk_class ExploreWClass
GroupAdd, folders2, ahk_class Progman
return

$F2::
if ( Winactive("ahk_group folders2") )
{
Send {F2}
Send ^+{end}
settimer, renombrar, 20
return
}
Else
{
Send {F2}
Return
}

renombrar:
WinWaitActive, Cambiar nombre ahk_class #32770
WinGetPos,,, warnw, warnh, Cambiar nombre
if (warnw = 515) and (warnh=154)
{
send, s
click up left
settimer, renombrar, off
return
}
Else
{
settimer, renombrar, off
return
}

Elaphe

Posted 2009-11-08T10:20:45.937

Reputation: 1

0

Make a vb-script that renames the file, place that in special folder "SendTo", right-click on file that needs its extension changed and fill in the new name. No warnings any more, and it only takes a few minutes to create the script. The script contains this:

on error resume next
Set objArg = Wscript.Arguments
do
   if objArg.Count < 1 then exit do
   fil=objArg(0)
   Set FSO = CreateObject("Scripting.FileSystemObject")
   if Err.Number > 0 then exit do
   Set f1 = FSO.GetFile(objArg(0))
   fil=f1.Name
   i=inputbox("","",fil)
   if i = fil then exit do
   f1.Name = i
   exit do
loop

Richard

Posted 2009-11-08T10:20:45.937

Reputation: 1

0

Here is an AutoHotkey script that mutes/unmutes the sound when the window pops up.

All the settings before the loop are how I start my every script for faster execution.

Edit the Sleep value untill you don't hear the beep.

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1

Loop
{
    WinWait, Rename ahk_class #32770 ahk_exe Explorer.EXE
    Send, {Volume_Mute}
    ControlClick, Button1
    Sleep, 800
    Send, {Volume_Mute}
}
Return

Mister Robato

Posted 2009-11-08T10:20:45.937

Reputation: 1

0

I really don't think this is possible without using either:

  1. Command Prompt (a hassle unless you're used to it)
  2. A third party workaround, either a file manager or something that deals with the prompt so you don't have to

Personally I use PTFB (Push the Freakin' Button); it's pretty low on resources and very fast. It's not exactly cheap, but is a handy thing to have for other stuff.

Paul Roberts

Posted 2009-11-08T10:20:45.937

Reputation: 1