Create a batch file with special characters from another batch file [duplicate]
This question already has an answer here:
Making batch file to write batch file
1 answer
How to put %random% to a new batch file with a batch file?
1 answer
I am trying to create a batch script that will create a new script with special characters, example:
set /p new_name= "New name of the file with extension :"
ren %rename_file% %new_name% 2>>error.log
del %rename_file%
del error.log
using the >>(name of new batch script)
, the user is asked to enter the file name with extension, any errors are caught by line 2
so it does not show on the screen. Then line 3
deletes the file and finally line 4
deletes the error log
My question, How do I get line 2
which contains >>
to be wrote into new batch script? If I simply type >>(new batch script name)
, it ignores that and sends it to error.log
.
batch-file
marked as duplicate by Stephan
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 15:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Making batch file to write batch file
1 answer
How to put %random% to a new batch file with a batch file?
1 answer
I am trying to create a batch script that will create a new script with special characters, example:
set /p new_name= "New name of the file with extension :"
ren %rename_file% %new_name% 2>>error.log
del %rename_file%
del error.log
using the >>(name of new batch script)
, the user is asked to enter the file name with extension, any errors are caught by line 2
so it does not show on the screen. Then line 3
deletes the file and finally line 4
deletes the error log
My question, How do I get line 2
which contains >>
to be wrote into new batch script? If I simply type >>(new batch script name)
, it ignores that and sends it to error.log
.
batch-file
marked as duplicate by Stephan
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 15:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Firstly the first list item should readSet /P "new_name=New name of the file with extension: "
. The second item should readRen "%rename_file%" "%new_name%" 2>Nul
. The other two lines are absolutely unnecessary. Characters such as>
whenEcho
ing need escaping with a caret,^
, i.e.^>
or^>^>
. As this is a common question, you should really delete it as it will be of no use to others moving forward.
– Compo
Jan 1 at 14:43
add a comment |
This question already has an answer here:
Making batch file to write batch file
1 answer
How to put %random% to a new batch file with a batch file?
1 answer
I am trying to create a batch script that will create a new script with special characters, example:
set /p new_name= "New name of the file with extension :"
ren %rename_file% %new_name% 2>>error.log
del %rename_file%
del error.log
using the >>(name of new batch script)
, the user is asked to enter the file name with extension, any errors are caught by line 2
so it does not show on the screen. Then line 3
deletes the file and finally line 4
deletes the error log
My question, How do I get line 2
which contains >>
to be wrote into new batch script? If I simply type >>(new batch script name)
, it ignores that and sends it to error.log
.
batch-file
This question already has an answer here:
Making batch file to write batch file
1 answer
How to put %random% to a new batch file with a batch file?
1 answer
I am trying to create a batch script that will create a new script with special characters, example:
set /p new_name= "New name of the file with extension :"
ren %rename_file% %new_name% 2>>error.log
del %rename_file%
del error.log
using the >>(name of new batch script)
, the user is asked to enter the file name with extension, any errors are caught by line 2
so it does not show on the screen. Then line 3
deletes the file and finally line 4
deletes the error log
My question, How do I get line 2
which contains >>
to be wrote into new batch script? If I simply type >>(new batch script name)
, it ignores that and sends it to error.log
.
This question already has an answer here:
Making batch file to write batch file
1 answer
How to put %random% to a new batch file with a batch file?
1 answer
batch-file
batch-file
edited Jan 1 at 14:50


Compo
16.6k3927
16.6k3927
asked Jan 1 at 13:28


Asgi WesaAsgi Wesa
162
162
marked as duplicate by Stephan
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 15:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Stephan
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 15:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Firstly the first list item should readSet /P "new_name=New name of the file with extension: "
. The second item should readRen "%rename_file%" "%new_name%" 2>Nul
. The other two lines are absolutely unnecessary. Characters such as>
whenEcho
ing need escaping with a caret,^
, i.e.^>
or^>^>
. As this is a common question, you should really delete it as it will be of no use to others moving forward.
– Compo
Jan 1 at 14:43
add a comment |
Firstly the first list item should readSet /P "new_name=New name of the file with extension: "
. The second item should readRen "%rename_file%" "%new_name%" 2>Nul
. The other two lines are absolutely unnecessary. Characters such as>
whenEcho
ing need escaping with a caret,^
, i.e.^>
or^>^>
. As this is a common question, you should really delete it as it will be of no use to others moving forward.
– Compo
Jan 1 at 14:43
Firstly the first list item should read
Set /P "new_name=New name of the file with extension: "
. The second item should read Ren "%rename_file%" "%new_name%" 2>Nul
. The other two lines are absolutely unnecessary. Characters such as >
when Echo
ing need escaping with a caret, ^
, i.e. ^>
or ^>^>
. As this is a common question, you should really delete it as it will be of no use to others moving forward.– Compo
Jan 1 at 14:43
Firstly the first list item should read
Set /P "new_name=New name of the file with extension: "
. The second item should read Ren "%rename_file%" "%new_name%" 2>Nul
. The other two lines are absolutely unnecessary. Characters such as >
when Echo
ing need escaping with a caret, ^
, i.e. ^>
or ^>^>
. As this is a common question, you should really delete it as it will be of no use to others moving forward.– Compo
Jan 1 at 14:43
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Firstly the first list item should read
Set /P "new_name=New name of the file with extension: "
. The second item should readRen "%rename_file%" "%new_name%" 2>Nul
. The other two lines are absolutely unnecessary. Characters such as>
whenEcho
ing need escaping with a caret,^
, i.e.^>
or^>^>
. As this is a common question, you should really delete it as it will be of no use to others moving forward.– Compo
Jan 1 at 14:43