Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to specify a custom command prompt when I launch a console. E.g Windows cmd.exe.

I am using the /K command line parameter in the shortcut that launches the console:

%SystemRoot%\system32\cmd.exe /K myprompt.bat

myprompt.bat contains the following lines:

prompt $d $t$_$p$g
cls

When I issue the prompt command manually in the console window, the prompt appears like this:

enter image description here

However, if I execute myprompt.bat (either manually, or using the /K command line parameter), I receive the following error:

enter image description here

What am I doing wrong?

share|improve this question
add comment

1 Answer

Try opening the batch file in notepad, and try another "encoding" option when you save it.

share|improve this answer
    
+1 The batch file has been saved as Unicode instead of ANSI. –  Karan Jul 10 '13 at 21:54
    
It is saved as Unicode. I also tried Unicode big endian, and UTF-8, but I get the same results. –  Welton v3.53 Jul 12 '13 at 14:54
    
I've ran into a similar problem before. I believe I ended up using the command line "Edit" and copying the script in there and saving it with a different file name. –  Don Nickel Jul 12 '13 at 15:10
    
@Weltonv3.51: As my previous comment suggests, did you save as ANSI and try? You don't even need to create a new file. Just use Save As in Notepad with the same name but ANSI encoding. –  Karan Jul 12 '13 at 18:05
1  
@DonNickel: If this is 64-bit Windows there's no Edit available anymore. –  Karan Jul 12 '13 at 18:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.