How do I type a path of a file if a folder has spaces in its' name and I can't/don't want to change it's name? - cmder

I'm using cmder as my command line and if I want to access folders inside a given one i'm already in, e.g. doing cd [foldername], I don't know how to access folders that have spaces in them because then cmder only processes the first word in the folder name instead of the full name.

How about:
cd "folder with space"
And you can also press tab before typing name and cmd will help you out.

Related

How to get name of admin folder in prestashop?

$link= PS_ADMIN_DIR;
$admin_folder = substr(strrchr($link, "\ "), 1);
currently i am using this way to get folder name,
But if there are any direct method or any constant please suggest me..
Thanks
To be a little bit more specific : the name of the admin directory is on the filesystem.
When you access a page of the admin directory, a script puts the current directory's path in the _PS_ADMIN_DIR_ constant.
If you forgot the name of the the admin directory you must have a look at the filesystem of your server.
Admin directories are automatically renamed to something like adminXXXX.
If you named it differently you can compare the default directory structure with your actual structure and find the proper directory.
You can also look for files that are only present in the admin directory. The "get-file-admin.php" file for example.
On linux, the following command run from the prestashop root directory will tell you the actual name of the admin directory :
find ./ -name get-file-admin.php
For security reasons, admin folder name is not stored anywhere in your PrestaShop's files or database, so you have to do something like you do to find it.
However, you should use _PS_ADMIN_DIR_ instead of PS_ADMIN_DIR as the second one is not defined directly by PrestaShop and could be undefined.

Sublime text show path content

Is there a setting or package that allows sublime text 2/3 to show what's in a path? For example I type app/ it shows me whatever is in app/ so I can press enter to select that file or folder.
Thanks,
Jordy
There is a package called FileSystem Autocompletion, which looks like it should show autocompletion entries based on files and folders that match the path you type - see https://packagecontrol.io/packages/FileSystem%20Autocompletion
EDIT: If that doesn't work for you, there are 2 more similar packages you could try:
https://packagecontrol.io/packages/FuzzyFilePath
https://packagecontrol.io/packages/AutoFileName

Windows 7 - Add Path

I need to add a new path (sumatraPDF) on my PATH variable.
I don't know why it does not work...
I think everything is right but when I try to execute sumatrapdf.exe from CMD it cannot find the program.
This is what I did:
The path is correct, I checked it 1000 times.
The idea is use LaTeX with sublimetext and when I save a .text file sumatra has to open and show to me the result. If I want that I have to add the path of SumatraPDF... but it does not work.
I think you are editing something in the windows registry but that has no effect on the path.
Try this:
How to Add, Remove or Edit Environment variables in Windows 7
the variable of interest is the PATH
also you can type on the command line:
Set PATH=%PATH%;(your new path);
Another method that worked for me on Windows 7 that did not require administrative privileges:
Click on the Start menu, search for "environment," click "Edit environment variables for your account."
In the window that opens, select "PATH" under "User variables for username" and click the "Edit..." button. Add your new path to the end of the existing Path, separated by a semi-colon (%PATH%;C:\Python27;...;C:\NewPath). Click OK on all the windows, open a new CMD window, and test the new variable.
I founded the problem:
Just insert the folder without the executable file.
so Instead of:
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe
you have to write this:
C:\Program Files (x86)\SumatraPDF\
In answer to the OP:
The PATH environment variable specifies which folders Windows will search in, in order to find such files as executable programs or DLLs. To make your Windows installation find your program, you specify the folder that the program resides in, NOT the program file itself!
So, if you want Windows to look for executables (or other desired files) in the folder:
C:\PHP
because, for example, you want to install PHP manually, and choose that folder into which to install PHP, then you add the entry:
C:\PHP
to your PATH environment variable, NOT an entry such as "C:\PHP\php.exe".
Once you've added the folder entry to your PATH environment variable, Windows will search that folder, and will execute ANY named executable file you specify, if that file happens to reside in that folder, just the same as with all the other existing PATH entries.
Before editing your PATH variable, though, protect yourself against foul ups in advance. Copy the existing value of the PATH variable to a Notepad file, and save it as a backup. If you make a mistake editing PATH, you can simply revert to the previous version with ease if you take this step.
Once you've done that, append your desired path entries to the text (again, I suggest you do this in Notepad so you can see what you're doing - the Windows 7 text box is a pain to read if you have even slight vision impairment), then paste that text into the Windows text box, and click OK.
Your PATH environment variable is a text string, consisting of a list of folder paths, each entry separated by semicolons. An example has already been given by someone else above, such as:
C:\Program Files; C:\Winnt; C:\Winnt\System32
Your exact version may vary depending upon your system.
So, to add "C:\PHP" to the above, you change it to read as follows:
C:\Program Files; C:\Winnt; C:\Winnt\System32; C:\PHP
Then you copy & paste that text into the windows dialogue box, click OK, and you should now have a new PATH variable, ready to roll. If your changes don't take effect immediately, you can always restart the computer.
The path is a list of directories where the command prompt will look for executable files, if it can't find it in the current directory. The OP seems to be trying to add the actual executable, when it just needs to specify the path where the executable is.
Try this in cmd:
cd address_of_sumatrapdf.exe_file && sumatrapdf.exe
Where you should put the address of your .exe file instead of adress_of_sumatrapdf.exe_file.

Path variable contains a period

I set my environment variable Path to the following
D:\Program Files\Java\jdk1.7.0_45\bin
But when I check it in the Windows command prompt, it outputs this:
PATH=D:\Program Files\Java\jdk1.7.0_45\bin;.;
My question: why did a period get added to the end, and what is its meaning?
A . means the "current working directory", which is added by default. Thus if you have a program with that name in the current working directory it will look there at the end.
It's a separate path to follow: "this (current) directory". For non-privileged users, it's common to add . to the Path so that you can just type the name of a command or program in your current directory and have it work. Are you saying that Path was empty before, and someone/something added . to the Path after you only added your Java path?
the period means the current directory!

Copy from CSV and Rename in MS-DOS

I have a .csv file with the following format:
<path_including_filename>,<new_filename>
<path_including_filename>,<new_filename>
<path_including_filename>,<new_filename>
<path_including_filename>,<new_filename>
I want to copy what's on column #1 in my CSV from Location A to Location B, then rename the file on Location B with the content of the column #2 in my CSV.
This is what I have done so far, the copying works but the renaming seems doesn't really happen:
For /F "tokens=1* delims=," %%i in (myCSV.csv) do (copy "%%i" "C:/myFolder" && rename "C:/myFolder/%%~nxi" "%%j")
Thanks in advance.
This answer used to contain my wrong suggestion from comments:
When the second column isn't a full pathname, but just a file name, rename "C:/myFolder/%%~nxi" "%%j" takes its destination argument as a path relative to current directory, not to the source directory.
I thought the problem should be solved by providing a full path name in the second argument of rename as well:
rename "C:/myFolder/%%~nxi" "C:/myFolder/%%j"
But no: the full path name is actually invalid in the destination argument for rename. The solution of cding to the target directory first and renaming without folder names in either argument turned out to work. I think that replacing forward slashes with backslashes in the first argument (leaving the second without the folder name) would help too: in my tests on Windows XP, rename failed with "file not found" when a source folder path contained forward slashes, and worked for backslashes.

Resources