Custom modification of the "new folder" command in windows 7 - subdirectory

A while ago todofixthis, answering somebody else's question, provided a nice little .cmd file, which he called open_dos_here.cmd. If you put this file in an arbitrary folder,then clicking on it would open a command window in that folder, rather than in the default folder. I'd like to extend this facility to avoid having to copy and paste the .cmd file into the new folder every time I create one. The easiest way to do this would be if I could customize windows' new folder command so that it does the copy and paste automatically whenever a new folder is created. Is this possible? If not, is there another way of accomplishing the same thing?
Thanks very much for any suggestions.

Good news for you. This functionality comes built-in with Windows 7.
Just press SHIFT before you right-click on a folder and select Open command window here.

You can modify the Windows context menu to add a shortcut to open a command prompt when right-clicking on a folder.
To add the option:
Run regedit.exe
Browse to
HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell.
Create a new key
called "Command Prompt". For the default value, enter whatever text
you want to appear when you right-click on a folder. eg.
Open Command Prompt.
Create a new subkey called "Command". Set the
default value to Cmd.exe /k pushd %L.
Exit the Registry Editor and your new right-click command will be ready to go.
Not exactly what you are asking for, but I use this on both my home and work PCs. It works a charm and sounds a lot easier than double-clicking a file every time.

Related

"SDL2.DLL missing from computer" but is in the same folder as program?

SDL Folder in the same directory:
Contents of SDL folder:
I cant get my program to run as it says it cannot find SDL2.DLL? Any ideas?
Programs don't search your entire hard drive for DLLs. That would be expensive, horribly insecure, and bug prone.
Instead they have a search path, which depends on how you load it. Often your PATH environment variable is used, together with various other system places, as well as the directory of the process loading the dynamic library.
This list rarely includes "a subdirectory of the process executable called SDL". You can, however, modify the search path; how exactly depends on how you are trying to load SDL.
The easy solution is to try to copy them all into the same directory.
You can use a Post-Build-Event to copy sdl2.dll into the directory where your .exe is built. Manually copying the file is fine for a quick test, but having Visual Studio do it for you has some advantages. For example, this lets you completely delete your Debug and Release directories and have the correct file copied when you do a clean build.
In your directory listing I see bin32 and bin64 directories inside the SDL directory. I assume that there is a copy of sdl2.dll directly inside each of those directories, but there are no separate debug and release versions, just 32-bit and 64-bit. Let me know if this is incorrect, otherwise, you can do this:
Open the Solution Explorer and select your project (not the solution). Then use Alt+Enter to go directly to the Property Pages. (Or right-click the project and select Properties at the bottom of the menu.)
In the selection panel on the left, go to Configuration Properties/Build Events/Post-Build Event.
At the top of the property sheet, set the Configuration dropdown to All Configurations and the Platform dropdown to All Platforms.
Click the edit box to the right of Command Line and enter this command:
copy "$(SolutionDir)SDL\bin$(PlatformArchitecture)\sdl2.dll" "$(TargetDir)"
Now click OK, and save and build your solution. You should find that it copies the correct version (32-bit or 64-bit) of sdl2.dll into the build directory.
The various $(FooBar) entries in the command line are macros which ar automatically expanded according to things like your project directory location, the type of platform you're building for, etc.
$(SolutionDir) is the directory containing your .sln file, with a trailing backlash.
$(PlatformArchitecture) is 32 or 64 depending on which platform you're building for.
$(TargetDir) is the directory that VS creates your .exe file in.
So this command line is an ordinary copy command as you might use in a command prompt, with the paths filled in to copy either SDL\bin32\sdl2.dll or SDL\bin64\sdl2.dll to your build target directory. We use quotes around the source and destination paths in case you have any spaces in your project path.
In some cases you may need specific commands for a particular configuration (Debug/Release) or platform (Win32/x64). You can do this by selecting that configuration or platform at the top of the property sheet. In our case, we can use one command for both 32-bit and 64-bit builds thanks to the $(PlatformArchitecture) macro.
To learn more about the macros, you can select the Command Line box in the property page and then click the drop-down arrow that appears to the right of the box, and select <Edit...>. This opens a multiline edit window (you can use more than one command in the build event), with an Evaluated value below it that shows the actual command that will be used for your current configuration and platform. You can inspect this command to see if it looks right, and you can also copy the evaluated command and paste it into a command prompt window for a quick test.
To see a full list of available macros and what they expand to for your current configuration/platform, click the Macros>> button below that and look through the list or use the search box at the top.

How to open Webstorm projects directly from a folder in Windows Explorer?

Is there a way to launch Webstorm so it opens a selected folder in Windows Explorer?
Instead of:
launching Webstorm (possibly on a different project from its last session);
closing the current project;
browsing for the desired project in the project wizard panel;
finally, opening it.
Something like:
Setup (a one time thing, per projects) a shortcut to Webstorm with an argument pointing to the given project.
Then you could just double-click that shortcut to start it off from that project!
Is there anything like this that exists? Or a way to register any folder with an .idea subfolder to have an "open with... -> Webstorm" right-click option?
Nevermind, figured it out.
The icon shortcut works by simply adding the whole path to your project as an argument to the Shortcut Target, like so:
(obviously, you can copy-paste it instead of typing it all by hand)
If you have multiple shortcuts setup and you open each ones, as far as I can tell... it opens them in separate Webstorm windows, leaving the previous one open. So you can jump between projects a bit more efficiently this way.

Can we change an exe icon according to the current solution configuration?

I want to know if there's a simple way to change my exe icon depending on compilation in release / debug / other configuration.
IDE is Visual Studio 2013, source code in C++.
Thanks in advance.
It may be possible using a combination of tricks.
Create an icon for each configuration and store them each in a folder with the same name as the configurations you use (like Debug, Release).
Use $(ConfigurationName) in a pre-build command line. Create a batch file to copy the correct icon to the 'source' location. In other words if the application icon is .\App.ico create a batch file: 'copy .\%1\App.ico .\App.ico' or similar. (obviously get the paths correct).
The batch will execute and overwrite the app icon with the custom build icon.
Change configuration and the icon can change. Just make sure that all icons are the same size.
I have used this to copy a text file into my builds - cannot see why it cannot work with icons.

How do I rename a Django project in PyCharm?

What do I need to do in order to rename my Django project in PyCharm? I am new to Django and PyCharm and would like to use a different name for my project.
The built-in solution for re-naming Django projects in PyCharm has worked for me in the past on small projects, although I haven't tried it on a large project yet. To use it, select the project folder from the file-tree (by default on the left hand side of the screen), then press shift-F6 to bring up the rename dialogue. You can enter in your new name here and preview the changes, which can help prevent surprises. If you're happy with the preview, click on the "Do Refactor" button at the bottom of the window.
This is also a useful way to rename Django apps.
You can access the same functionality through right-clicking on the folder/item and hovering over the Refactor sub-menu. Or pressing ctrl+shift+a and searching for rename.
I'm using Windows, but it's probably the same for other operating systems.
Close PyCharm, open the directory in Windows Explorer (or your favorite file manager).
Rename the project directory
Rename the subdirectory of the same name that is inside your project directory
Open the .idea directory (in the project folder), rename the .iml file
Also in the .idea directory, open the .name file in a text editor and change the name in there
Open the project in PyCharm again.
In the settings.py file, you'll need to update the path specified in TEMPLATE_DIRS
You may also want to update your Run/Debug configurations (Alt-Shift-F10).
You'll need to replace some other occurrences of your old project name. In PyCharm, Ctrl-Shift-F will allow you to search the contents of all your files to find these occurrences.
Maybe: right-click on root folder in "Project" window, choose Refactoring -> Rename and choose "Rename Project"
svass's answer worked for me, except that I also had to manually change instances of my old project name in files located inside the .idea directory of my project.
If you cd into your project directory and grep for your old project name
grep -rli oldprojectname ./.idea
That returned the following list for me, then I manually modified each file.
./.idea/modules.xml
./.idea/workspace.xml
./.idea/dataSources.xml
./.idea/oldprojectname.iml <-- this will need to be renamed to new project name, and it's contents modified
./.idea/dataSources.ids
./.idea/.name
./.idea/misc.xml

How to change the default *.exe icon in C/C++?

I want to change the default .exe icon to some other icon in C/C++. Does anybody know how to do that?
Already answered.
Change app icon in Visual Studio 2005?
You have to place your .ico file in the resources folder first of course.
Use this one: http://www.angusj.com/resourcehacker/
Since you specified that you are using VS2008 I can point you here: How do I set the icon for my application in visual studio 2008? (duplicate question)
On Windows, if the executable contains many icons, the 1st of them will be the default.
If you have icons resource in your programming environment, place the icon you want first in the list.
Edit: since you created an empty project, to add an icon, follow these instructions:
(as I said in my comment, I don't have VS2008, but the steps should be the same)
Menu: Insert -> Resource -> Import
Select "Icon", press the import button and select your icon file.
Now, close the icon editor, and save the resource script in the project folder.
Select "Files View" and add the resource script file in the "Resource Files".
That's it.
if you are using any ide like dev c++, then you can specify the icon you want to appear on your file in project options