Create a batch file with special characters from another batch file [duplicate]












0
















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.










share|improve this question















marked as duplicate by Stephan batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

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 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 Echoing 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


















0
















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.










share|improve this question















marked as duplicate by Stephan batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

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 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 Echoing 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
















0












0








0









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.










share|improve this question

















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

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 batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

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 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 Echoing 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 Echoing 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 Echoing 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 Echoing 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














0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory