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.
windows-10 command-prompt
add a comment |
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.
windows-10 command-prompt
what do you mean byFind the path of another command prompt? Each console has a CWD but you can't access it from outside. AndDIR /S /A C:Foldername name.cmdjust finds a file namedname.cmdinside C:Foldername. The/Apart is useless because you must provide attributes with it like/A:HS... Seedir /?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 findname.cmdatC:userswesleydesktopfoldernamethen 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 isname.cmdrelated 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
add a comment |
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.
windows-10 command-prompt
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
windows-10 command-prompt
edited Nov 11 at 2:20
asked Nov 10 at 17:11
Noobblue
13
13
what do you mean byFind the path of another command prompt? Each console has a CWD but you can't access it from outside. AndDIR /S /A C:Foldername name.cmdjust finds a file namedname.cmdinside C:Foldername. The/Apart is useless because you must provide attributes with it like/A:HS... Seedir /?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 findname.cmdatC:userswesleydesktopfoldernamethen 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 isname.cmdrelated 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
add a comment |
what do you mean byFind the path of another command prompt? Each console has a CWD but you can't access it from outside. AndDIR /S /A C:Foldername name.cmdjust finds a file namedname.cmdinside C:Foldername. The/Apart is useless because you must provide attributes with it like/A:HS... Seedir /?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 findname.cmdatC:userswesleydesktopfoldernamethen 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 isname.cmdrelated 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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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. AndDIR /S /A C:Foldername name.cmdjust finds a file namedname.cmdinside C:Foldername. The/Apart is useless because you must provide attributes with it like/A:HS... Seedir /?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.cmdatC:userswesleydesktopfoldernamethen 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.cmdrelated 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