How to query current Directory name into a variable for batch filesHow to set a folder name into a variable...
What are the rules for concealing thieves' tools (or items in general)?
Do I need an EFI partition for each 18.04 ubuntu I have on my HD?
Knife as defense against stray dogs
Why I don't get the wanted width of tcbox?
What will the Frenchman say?
CLI: Get information Ubuntu releases
Does the Shadow Magic sorcerer's Eyes of the Dark feature work on all Darkness spells or just his/her own?
Air travel with refrigerated insulin
Pre-Employment Background Check With Consent For Future Checks
Print last inputted byte
How can a new country break out from a developed country without war?
What is the difference between something being completely legal and being completely decriminalized?
Why do I have a large white artefact on the rendered image?
How can an organ that provides biological immortality be unable to regenerate?
Why didn’t Eve recognize the little cockroach as a living organism?
label a part of commutative diagram
How do you justify more code being written by following clean code practices?
Asserting that Atheism and Theism are both faith based positions
is this saw blade faulty?
What are the consequences of changing the number of hours in a day?
Does fire aspect on a sword, destroy mob drops?
Turning a hard to access nut?
pipe commands inside find -exec?
Why is indicated airspeed rather than ground speed used during the takeoff roll?
How to query current Directory name into a variable for batch files
How to set a folder name into a variable to use it in the same Batch file?Batch: Set Top-Level Folder Name as VariableHow can I launch batch files from another batch file while piping their output and retaining the current working directory?Creating a txt file for certain type of files using batchHow to write into a Log file from the batch file?The Directory name is too long in batchsend output of batch file to current directoryBatch File:List all files of a type, rename files, flatten the directoryHow to set a folder name into a variable to use it in the same Batch file?Batch to move files from root folder into sub-foldershow to create empty text files who's name matches those in an existing folder using a batch fileBatch: Set Top-Level Folder Name as Variable
I have been researching and trying without success to get the current directory name into a variable such as %CurrDirNam% for creating a text file with the same folder name something like this: copy %CurrDirNam% > nul 1.txt.
The only similar questions I can locate require that the folder name be supplied rather than fetching it from the OS for use as a variable.
Reference1 How to set a folder name into a variable to use it in the same Batch file? Reference2 Batch: Set Top-Level Folder Name as Variable
windows batch-file
New contributor
add a comment |
I have been researching and trying without success to get the current directory name into a variable such as %CurrDirNam% for creating a text file with the same folder name something like this: copy %CurrDirNam% > nul 1.txt.
The only similar questions I can locate require that the folder name be supplied rather than fetching it from the OS for use as a variable.
Reference1 How to set a folder name into a variable to use it in the same Batch file? Reference2 Batch: Set Top-Level Folder Name as Variable
windows batch-file
New contributor
add a comment |
I have been researching and trying without success to get the current directory name into a variable such as %CurrDirNam% for creating a text file with the same folder name something like this: copy %CurrDirNam% > nul 1.txt.
The only similar questions I can locate require that the folder name be supplied rather than fetching it from the OS for use as a variable.
Reference1 How to set a folder name into a variable to use it in the same Batch file? Reference2 Batch: Set Top-Level Folder Name as Variable
windows batch-file
New contributor
I have been researching and trying without success to get the current directory name into a variable such as %CurrDirNam% for creating a text file with the same folder name something like this: copy %CurrDirNam% > nul 1.txt.
The only similar questions I can locate require that the folder name be supplied rather than fetching it from the OS for use as a variable.
Reference1 How to set a folder name into a variable to use it in the same Batch file? Reference2 Batch: Set Top-Level Folder Name as Variable
windows batch-file
windows batch-file
New contributor
New contributor
New contributor
asked 2 mins ago
JoanneJoanne
1
1
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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',
autoActivateHeartbeat: false,
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
});
}
});
Joanne is a new contributor. Be nice, and check out our Code of Conduct.
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%2fsuperuser.com%2fquestions%2f1415205%2fhow-to-query-current-directory-name-into-a-variable-for-batch-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Joanne is a new contributor. Be nice, and check out our Code of Conduct.
Joanne is a new contributor. Be nice, and check out our Code of Conduct.
Joanne is a new contributor. Be nice, and check out our Code of Conduct.
Joanne is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2fsuperuser.com%2fquestions%2f1415205%2fhow-to-query-current-directory-name-into-a-variable-for-batch-files%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