Where is "xcopy" usually located on a development machine? [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have a build process that needs to use xcopy. I am getting an error, and I want to make sure that it is finding the command ok.
But google is not helpful when searching for where xcopy would be located on my (or my build) machine.
What is the file path to XCOPY?

Usually %WINDIR%\system32 e.g. C:\Windows\system32.
Be aware that on a 64-bit machine, there's some magic going on with the result that what appears to be C:\Windows\system32 is actually C:\Windows\SysWOW64. However for your purposes I don't believe this should matter.

xcopy.exe is located under C:\Windows\system32\xcopy.exe. There also exists a 32-bit version under C:\Windows\SysWOW64\xcopy.exe if you're running an x64 version of Windows.

The following command line show where the xcopy.exe file is located so it is equivalent to where xcopy.exe command, but it works in any Windows version:
for %a in (xcopy.exe) do #echo %~$path:a

If you really want it to be accurate, you should use the same method Windows uses to load an executable.
Where is a 3rd-party utility including source, that has an excellent explanation of how Windows locates an executable, dll, etc. It also matters whether you run it via ShellExec or CreateProcess

Related

How to use program name with out specific path in .cmd file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
When I usually type following command in command prompt,
pageant "C:\Users\test\.ssh\id_rsa.ppk"
It have worked well.
But on the other hands,when I make test.cmd file like
pageant "C:\Users\test\.ssh\id_rsa.ppk"
And then double click, it didn't work
buttest.cmd in following script
"C:\Program Files\PuTTY\pageant.exe" "C:\Users\test\.ssh\id_rsa.ppk"
work well.
What is the different between them ?
I guess The path was recognized by cmd.
If someone has opinion, please let me know
If the command doesn't contain an absolute path and isn't an internal command then cmd.exe will find the executable in the current folder and then look in the folders in the %PATH% environment variable. It looks like the current folder in your cmd is C:\Program Files\PuTTY so pageant can be found and execute normally. If you cd to a different folder then it won't work unless the folder exists in %PATH%

W10 CMD forfiles [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
Since I had a task where I have to copy recursively files of a nested directory for work, i discovered the forfiles-function in windows cmd.
It worked properly and now I wonder how does the function distinguish between a file and a directory?
If every file had a file extension like .jpg .png .xls or something like that, I could understand it, but some of my files came without extensions, but it still did its job.
As I'm used to linux, I tried to google the sourcecode, but windows applications aren't opensource, so if anybody can explain me, how does it work, it would be very interesting to know.
PS: why does this got downvoted? its a general question
The command will eventually call the Windows FindFirstFile/FindNextFile functions. Those return a WIN32_FIND_DATA structure which may contain a FILE_ATTRIBUTE_DIRECTORY flag. If that flag is not set, it's a file.
Internally there is quite a difference between a file and a directory, and it's no surprise that typical file/directory handling commands know about this. The fact that a file doesn't have an extension (or that a directory is called "directory.jpeg") does not cause any confusion within those commands.
If you check forfiles' "man page" (forfiles /?), you might see that the /C switch gives you access to the #isdir variable, which can tell you the difference: are you dealing with a directory (value:TRUE) or a file (value:FALSE)?

migrating any windows program to another pc (without installer GUI) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I am looking for a way to remotely install a program to other computer units running Windows on the fly ,without the need of running the installer steps on each computer (next,next,finish...) all over again , .exe installers don't usually have an easy way to do this without using the GUI installer.
a solution that i came up with , running the installer on a single pc
and try to trace each file the installer adds (location,file names,registry files) using FileSystemWatcher then copy these files and send them to the desired hosts that need the program installed with the location of each file will this work ? is there any easier implementation
the problem with FileSystemWatcher that although it detectes which files have been added,edited or deleted its not capable to tell which process did the change ,Why would i need to know ?,other programs depends alot on files and will keep editing them so i need to isolate the installer process to easily study how its functioning and what files are added..
the only way that i know to overcome this problem is developing a file system filter driver...
please give me your opinion or some recommendations on which is the best way to do this ,sorry for my bad english .
Almost every modern installer has some way to perform a silent install. You may need to do some digging to find the answers, or ask the publisher. Try running the installer with /? as a command line switch and see what it tells you.

shared drive cannot run .exe file while using windows 7 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a application called MARN.EXE which stores in a shared drive and works fine on our Windows XP system.
However since we use Windows7, we cannot run this EXE file. error is
Can't run 16-bit Windows program
Cannot find file {filepath\MARN.EXE} (or one of it's components). Check to ensure the path and filename are correct and that all required libraries are available.
I'm sure I have the Full Control to that shared drive folder.
and if I copy this folder to my local laptop, it runs fine. So seems not Windows7 problem.
Does anyone know what's the issue? Thank you.
(In properties
Target: "X:\Cusdfhr Cweihe\CS 1 Svc100\Psqw\MARN.EXE" PDAS.MDB
Start in: "X:\Cusdfhr Cweihe\CS 1 Svc100\Psqw"
)
The problem is the path. Old 16-bit programs actually run on Win7 BUT there are some restrictions to the folder names. Removing spaces, dashes, etc. should do the trick. Just replace whitespaces with _ and don't use long folder names.

Cannot find cygwin directories in Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am using cygwin to learn BASH scripting inside windows. I created a directory /mystuff/unixstuff. I tried searching for this unixstuff directory in windows, but I cannot find it. Where does cygwin create files and folders ?
Cygwin's root (/) directory is wherever you tell setup.exe to put it when you first install Cygwin.
I think the default is C:\cgywin. I've also used D:\cygwin.
You can use the cygpath command from the Cygwin bash shell to tell you. I'm not on my Cygwin system at the moment, but I think cygpath -w / will show you the Windows path of the Cygwin root, and cygpath -w /mystuff/unixstuff should tell you the Windows path to your /mystuff/unixstuff directory.
BTW, the usual convention for Unix-like systems (including Cygwin) is to put your own files under your home directory. Putting things directly under the root, as you've done with your /mystuff directory, risks interfering with system files. (Your home directory is probably /home/username, or in Windows something like C:\cygwin\home\username.)

Resources