Unable to find files in Documents from cmd - cmd

I am using Windows 10 and when I save a document I see the Documents folder it is being saved to on the left of the screen in the list under 'thisPC'. The bottom of that list has the C: drive. From Powershell, Bash or command prompt when I try to cd or locate the file I just saved I am told that it cannot find such a file. Why is my home directory the C: and not include the other files I mainly work with? I appreciate any help. Thank you

Command prompt works with files and folders.
Explorer works with virtual files or folders. Explorer is for users to easily find their stuff.
In Command prompt there is no such thing as This PC or anything under it. These are virtual things.
dir "%userprofile%\documents"
will list the files in your Documents folder if it is in the default location.

Related

Viewing and copying document on a laptop onto a usb only using command prompt

I am trying to download a file onto a usb from my laptop which is suffering from software issues. I used the command C:users\username>\dir documents on another pc, and was able to view the documents in the folder however, on the laptop in question, the command did not work and I was given the message "The system cannot find the path specified." I am trying to find the name of the document I need to copy so I am requesting a command which enables me to view all documents in the folder. After I find the name of the document, I am also unaware of how I can use command prompt to copy the file onto the USB i have inserted.
I am accessing the command prompt through System Recovery. I do not know code in any form. IMPORTANT Information which may be the reason for the lack of ability to do anything. When I type prompt>dir ****.docx /s /p, I get the message Volume in drive C has no label rather than Windows 7.
This could help-
http://www.dummies.com/computers/operating-systems/windows-xp-vista/how-to-search-for-files-from-the-dos-command-prompt/
As for copying files in cmd, it's as easy as-
prompt>copy <source> <destination>
For changing the drive (to the USB drive), use the "/d" option-
prompt>cd /d <USB drive name>
To view all the contents of current directory, use "dir"-
prompt>dir
Basically, you're not using right syntax. Kindly make cd c:\users and than write dir like this C:> cd C:/Users than your directory will be changed after that you can see C:/Users. So you can write dir in order to see your directories

How to Recover data using command prompt?

I lost my folder and now i want to recover my data using command prompt.
So, how can i recover my folder and which command is used ?
Thanks in advance.
Using command prompt you can use the System Restore "rstrui.exe".
You could also follow this guide from Cnet to recover files from Recycle Bin using Command Prompt.
To Recover Files in NTFS:
Click Start, Run and enter %systemdrive%\Recycler. Under this folder
you'll see sub folders with names like:
S-1-5-21-1085031214-854245398-1060284298-1003
One of these is your user's Recycle Bin folder, you'll have to
determine which. Then open a Command Prompt Window and type: Start/Run
and type in: CMD
CD\Recycled\ Next type DIR
Locate the files with the file extension that you wish to recover.
There may be more than one of the same type. These files will all be
DC??.xxx where ?? is a number and xxx is the file extension.
Use the COPY command to copy all of the matching files out. For
example: COPY *.DOC C:\Temp
to copy all DOC files to C:\Temp. Now you can open these files and
find the one(s) that you wanted to retrieve.
Guide: https://www.cnet.com/forums/discussions/recovering-permanently-deleted-files-help-226105/

Windows 10 and WSL - Directories not appearing in Bash when created in File Explorer

Using Windows 10 Enterprise Insider Preview Buil 14372.rs1_release.160620-2342
When I create a directory in Bash (e.g. mkdir test_from_bash) it appears in the File Explorer but the opposite doesn't work. File Explorer -> New Folder (call it 'test_from_gui') then running ls -al in Bash does not show the new directory.
I don't think this is a permissions problem since I went into the Properties -> Security section for each directory using the File Explorer and both of the aforementioned directories both have every box checked except for 'Special permissions' at the bottom of the list.
Result from ls -al:
File explorer:
Is this a bug?
Workaround -
Create and work out of directories that are outside of the Ubuntu 'container', you can find them in the /mnt directory. For example, you can happily read/write/modify/delete files from C:\Users in Windows Explorer (or cmd or anywhere else in Windows land) and also do the same from Bash but those files will be located in /mnt/c/Users. Not perfect, though, and I'd love to see a better answer.

os.listdir() showing file actually not in the folder on Python and Windows

The following Python script:
import os
print os.listdir('D:\images')
is outputing the names of all the folders in the D:\image directory, but it is also showing desktop.ini in the same folder, while there is no such file in the image directory.
Its also not a hidden item, I am sure of that.
Why is it then showing it as a content?
desktop.ini is a protected system file, and Windows tends to hide it.
You can verify by going to D:\images in a terminal and running dir /A.
See this answer as well.
You can use os.walk() if you want more control, it will give you directories and files separately. You can also use os.path.isdir() to find out if an entry you get is a directory.
I used os.path.isdir(path) to check whether the item returned by os.listdir() is a directory or not
This way,desktop.ini didn't meet the criteria of being a directory and my program scanned all the folders.

How to copy certain files from the same directory to another dirctory in Windows Command Prompt?

I am fairly new here and didn't use a lot of Windows Command Prompt's advanced function. So bear with me...
Currently, I have a folder containing a lot of image files. The example file name is like 20130611.084021.c123.tif, which means YrMoDy.HrMinSec.cameraIDs.tif.
So I want to copy all of the files have the same following information in their file names to another folder: 20130611.08xxxx.c1xx.tif.
How can I do this in Windows Command Prompt?
copy 20130611.08*.c1*.tif <destination folder>

Resources