How do I use Command Prompt to Find only execuatable files in drive C - command

I need to search for possible virus in drive c. I believe it is in .exe format.
Please advice on how to use command prompt to achieve this.

This will give you a list of exe files.
dir c:\*.exe /s >"%userprofile%\desktop\exelist.txt"

The above will not search all dirs/folders, try cd %userprofile%
and then
for /r /d %G in ('*.exe') DO echo Found Exe : %I

Related

Simple xcopy script using variables and a target text list to copy a folder to different computers

I wrote a script that wil copy a particular folder to a list of hosts, stored in a text file.
It works great from a short source path but fails to find the folder when located in a long path, which is how i need it to function.
Thsi what i tried, which should copy the folder to the list in the text.
Code below
set source=%~dp0%data
set source2=%~dp0%\target.txt
FOR /F "TOKENS=*" %%A IN (%source2%) DO XCOPY /d /y /f /i "%source%" "\%%~A\c$\users\test\test"
pause
Error: The system cannot find the file C:\Users\lenovo\OneDrive\Company\Red.
The above path is not the full path.
I understand there may well be more modern ways to achive this such as ropcopy or powershell and am open to ideas if this is not teh best method.
Thanks in advance for any help

Unable to change directory in command line

I'm on c drive in command line
when I want to change the directory to D drive using :
cd /C D:\Riot Games
I get an error also with cmder
Assuming you're using Windows, and you're using the standard cmd.exe for your command line, you should be quoting your path arguments for safety even though the docs will tell you it isn't strictly necessary since the command doesn't treat spaces as delimiters. The correct syntax is simply:
cd "D:\Riot Games"
There is also no /C argument to the cd command. You may have meant to use:
cd /D "D:\Riot Games"
to change the current drive in addition to changing the current directory, but whether that's actually necessary isn't clear from your example.
On Windows CMD, you first need to switch to your other drive by just typing D:, then you can change directory by using the cd "Riot Games"

7zip command line synthax using wildcard

Based on this source, the following should work for the 7zip command line tool:
7zG a -tzip "C:\20131024_archive.zip" "C:\archive" *20131024*
The goal is to zip all the files containing the date in the name. However, this is not working for me as it zips all the files without the date filter.
I've tried all sorts of variants without success. What am I doing wrong?
It turns out the date filter goes into the target filename like so:
7zG a -tzip "C:\20131024_archive.zip" "C:\archive\*20131024*"
Just use forfiles if your using windows 7. Type forfiles /? for more info. A think this will do what you want:
pushd C:\archive
forfiles /m "*20131024*" /c "7zG a -tzip C:\20131024_archive.zip #file"
I'm not sure this will work if the file name has spaces.

DOS Command FindStr

I have a need to use the DOS command FINDSTR to search in all our source code files mixed with other types of files such as PDF, exe, dll, etc.
I do not need to search those binary files. Is there a way to exclude binary files?
My command looks like
findstr /r /n /o /s /g:c:\projects\vsssearch\muafinddata.txt /d:c:/projects/axl *.axl > output.txt
Thanks in advance for any insight.
John
Do yo try /p? Help says: "/P Skip files with non-printable characters."

Making batch file for copying

Can anyone advise me please im using Windows XP Pro on C drive and need to be able to copy a file from one drive to another. This case original will have to be renamed and old file must be put on another Partiton which is on a Server Example K drive.
Alternately There is another option using Windows 7 on a another computer instead of Windows XP Pro. So any answers appreciated.
A quick look on my old DOS book that I saved just in case that I have to make batch files says COPY is the right command.
Syntax:
COPY DRIVE:FILENAME DRIVE:FILENAME
COPY THISFILE THATFILE
If your permissions are setup to allow copying, you can use "UNC" paths to copy files across servers and drives.
Like Noah said, check out ROBOCOPY or the slightly less featured XCOPY.
Enter copy /? or xcopy /? to find out the available options - if you append >file.txt you'll get them in a text file.
XCOPY Command:
xcopy c:\sourceDirectory\*.* d:\destinationDirectory\*.* /D /E /C /R /Y
ROBOCOPY Command:
robocopy c:\sourceDirectory\*.* d:\destinationDirectory\*.* /R:5 /W:3 /Z /XX /TEE
Either of these should work for you
Have you looked into robocopy?