Finding a file path, then using that file path to copy+paste the file











up vote
0
down vote

favorite












So, I'm trying to make a command prompt that will:



1.Find the path of another command prompt



2.Copy and paste that file



So far I have the first part down. I can locate said command prompt using cd then DIR /S C:Foldername name.cmdthe problem I'm running into is: I would like the command prompt to be able to find it wherever the folder is, so that if I move the folder the command prompt can still be used to copy the file to the specified location, however, I can't figure out how to copy+paste the file, without typing in it's location myself.



Is there some way for me to have the command prompt find the path of the file, then input the path it found into the copy command so that it knows what it's copying? Or am I going about this the wrong way? Should I be using DIR to locate it? Or is there another command I overlooked that will magically solve this problem?



Thank you in advance to anyone who responds.










share|improve this question
























  • what do you mean by Find the path of another command prompt? Each console has a CWD but you can't access it from outside. And DIR /S /A C:Foldername name.cmd just finds a file named name.cmd inside C:Foldername. The /A part is useless because you must provide attributes with it like /A:HS... See dir /? for more information
    – phuclv
    Nov 10 at 23:06












  • By, find the path of another command prompt, I mean for the command prompt to not just locate it, but to somehow use the path, for example if it were to find name.cmd at C:userswesleydesktopfoldername then it would be able to copy it from there. I hope that helps.
    – Noobblue
    Nov 11 at 2:19












  • It doesn't make sense. How is name.cmd related to "another command prompt"? There's only a single command prompt in Windows: cmd.exe and *.cmd is just a script that cmd.exe can run. It's not a command prompt. Looks like you want to copy the *.cmd file to somewhere, right? But from another *.cmd file or right from inside the *.cmd file itself?
    – phuclv
    Nov 11 at 3:22










  • Yes, that is correct. I'm sorry for not explaining it properly.
    – Noobblue
    Nov 11 at 3:41















up vote
0
down vote

favorite












So, I'm trying to make a command prompt that will:



1.Find the path of another command prompt



2.Copy and paste that file



So far I have the first part down. I can locate said command prompt using cd then DIR /S C:Foldername name.cmdthe problem I'm running into is: I would like the command prompt to be able to find it wherever the folder is, so that if I move the folder the command prompt can still be used to copy the file to the specified location, however, I can't figure out how to copy+paste the file, without typing in it's location myself.



Is there some way for me to have the command prompt find the path of the file, then input the path it found into the copy command so that it knows what it's copying? Or am I going about this the wrong way? Should I be using DIR to locate it? Or is there another command I overlooked that will magically solve this problem?



Thank you in advance to anyone who responds.










share|improve this question
























  • what do you mean by Find the path of another command prompt? Each console has a CWD but you can't access it from outside. And DIR /S /A C:Foldername name.cmd just finds a file named name.cmd inside C:Foldername. The /A part is useless because you must provide attributes with it like /A:HS... See dir /? for more information
    – phuclv
    Nov 10 at 23:06












  • By, find the path of another command prompt, I mean for the command prompt to not just locate it, but to somehow use the path, for example if it were to find name.cmd at C:userswesleydesktopfoldername then it would be able to copy it from there. I hope that helps.
    – Noobblue
    Nov 11 at 2:19












  • It doesn't make sense. How is name.cmd related to "another command prompt"? There's only a single command prompt in Windows: cmd.exe and *.cmd is just a script that cmd.exe can run. It's not a command prompt. Looks like you want to copy the *.cmd file to somewhere, right? But from another *.cmd file or right from inside the *.cmd file itself?
    – phuclv
    Nov 11 at 3:22










  • Yes, that is correct. I'm sorry for not explaining it properly.
    – Noobblue
    Nov 11 at 3:41













up vote
0
down vote

favorite









up vote
0
down vote

favorite











So, I'm trying to make a command prompt that will:



1.Find the path of another command prompt



2.Copy and paste that file



So far I have the first part down. I can locate said command prompt using cd then DIR /S C:Foldername name.cmdthe problem I'm running into is: I would like the command prompt to be able to find it wherever the folder is, so that if I move the folder the command prompt can still be used to copy the file to the specified location, however, I can't figure out how to copy+paste the file, without typing in it's location myself.



Is there some way for me to have the command prompt find the path of the file, then input the path it found into the copy command so that it knows what it's copying? Or am I going about this the wrong way? Should I be using DIR to locate it? Or is there another command I overlooked that will magically solve this problem?



Thank you in advance to anyone who responds.










share|improve this question















So, I'm trying to make a command prompt that will:



1.Find the path of another command prompt



2.Copy and paste that file



So far I have the first part down. I can locate said command prompt using cd then DIR /S C:Foldername name.cmdthe problem I'm running into is: I would like the command prompt to be able to find it wherever the folder is, so that if I move the folder the command prompt can still be used to copy the file to the specified location, however, I can't figure out how to copy+paste the file, without typing in it's location myself.



Is there some way for me to have the command prompt find the path of the file, then input the path it found into the copy command so that it knows what it's copying? Or am I going about this the wrong way? Should I be using DIR to locate it? Or is there another command I overlooked that will magically solve this problem?



Thank you in advance to anyone who responds.







windows-10 command-prompt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 2:20

























asked Nov 10 at 17:11









Noobblue

13




13












  • what do you mean by Find the path of another command prompt? Each console has a CWD but you can't access it from outside. And DIR /S /A C:Foldername name.cmd just finds a file named name.cmd inside C:Foldername. The /A part is useless because you must provide attributes with it like /A:HS... See dir /? for more information
    – phuclv
    Nov 10 at 23:06












  • By, find the path of another command prompt, I mean for the command prompt to not just locate it, but to somehow use the path, for example if it were to find name.cmd at C:userswesleydesktopfoldername then it would be able to copy it from there. I hope that helps.
    – Noobblue
    Nov 11 at 2:19












  • It doesn't make sense. How is name.cmd related to "another command prompt"? There's only a single command prompt in Windows: cmd.exe and *.cmd is just a script that cmd.exe can run. It's not a command prompt. Looks like you want to copy the *.cmd file to somewhere, right? But from another *.cmd file or right from inside the *.cmd file itself?
    – phuclv
    Nov 11 at 3:22










  • Yes, that is correct. I'm sorry for not explaining it properly.
    – Noobblue
    Nov 11 at 3:41


















  • what do you mean by Find the path of another command prompt? Each console has a CWD but you can't access it from outside. And DIR /S /A C:Foldername name.cmd just finds a file named name.cmd inside C:Foldername. The /A part is useless because you must provide attributes with it like /A:HS... See dir /? for more information
    – phuclv
    Nov 10 at 23:06












  • By, find the path of another command prompt, I mean for the command prompt to not just locate it, but to somehow use the path, for example if it were to find name.cmd at C:userswesleydesktopfoldername then it would be able to copy it from there. I hope that helps.
    – Noobblue
    Nov 11 at 2:19












  • It doesn't make sense. How is name.cmd related to "another command prompt"? There's only a single command prompt in Windows: cmd.exe and *.cmd is just a script that cmd.exe can run. It's not a command prompt. Looks like you want to copy the *.cmd file to somewhere, right? But from another *.cmd file or right from inside the *.cmd file itself?
    – phuclv
    Nov 11 at 3:22










  • Yes, that is correct. I'm sorry for not explaining it properly.
    – Noobblue
    Nov 11 at 3:41
















what do you mean by Find the path of another command prompt? Each console has a CWD but you can't access it from outside. And DIR /S /A C:Foldername name.cmd just finds a file named name.cmd inside C:Foldername. The /A part is useless because you must provide attributes with it like /A:HS... See dir /? for more information
– phuclv
Nov 10 at 23:06






what do you mean by Find the path of another command prompt? Each console has a CWD but you can't access it from outside. And DIR /S /A C:Foldername name.cmd just finds a file named name.cmd inside C:Foldername. The /A part is useless because you must provide attributes with it like /A:HS... See dir /? for more information
– phuclv
Nov 10 at 23:06














By, find the path of another command prompt, I mean for the command prompt to not just locate it, but to somehow use the path, for example if it were to find name.cmd at C:userswesleydesktopfoldername then it would be able to copy it from there. I hope that helps.
– Noobblue
Nov 11 at 2:19






By, find the path of another command prompt, I mean for the command prompt to not just locate it, but to somehow use the path, for example if it were to find name.cmd at C:userswesleydesktopfoldername then it would be able to copy it from there. I hope that helps.
– Noobblue
Nov 11 at 2:19














It doesn't make sense. How is name.cmd related to "another command prompt"? There's only a single command prompt in Windows: cmd.exe and *.cmd is just a script that cmd.exe can run. It's not a command prompt. Looks like you want to copy the *.cmd file to somewhere, right? But from another *.cmd file or right from inside the *.cmd file itself?
– phuclv
Nov 11 at 3:22




It doesn't make sense. How is name.cmd related to "another command prompt"? There's only a single command prompt in Windows: cmd.exe and *.cmd is just a script that cmd.exe can run. It's not a command prompt. Looks like you want to copy the *.cmd file to somewhere, right? But from another *.cmd file or right from inside the *.cmd file itself?
– phuclv
Nov 11 at 3:22












Yes, that is correct. I'm sorry for not explaining it properly.
– Noobblue
Nov 11 at 3:41




Yes, that is correct. I'm sorry for not explaining it properly.
– Noobblue
Nov 11 at 3:41

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241396%2ffinding-a-file-path-then-using-that-file-path-to-copypaste-the-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241396%2ffinding-a-file-path-then-using-that-file-path-to-copypaste-the-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

The Sandy Post

Danny Elfman

Pages that link to "Head v. Amoskeag Manufacturing Co."