need help(its complicated for me) RRS feed

  • Question

  • hello, im new on making batch files and im asking of hot do i make complete a command on a batch file(bad explination sorry)

    its like this.......

    if i whant a command like del [filename]

    i want to only show "what file do you want to delete:" and at the end is [filename](which i want to input it anyway i want to the filename)

    what file do you want to delete: ->this place where i input the [filename] i want<-



    @echo off del "[filename]"<- were the command will be completed on the next line. set /p del=what file do you want to delete: [filename] <-anything will be inserted to complete the del command

    idk after this....

    thx i hope tou people will understand
    Sunday, July 7, 2019 1:10 PM

All replies

  • I'm sorry, but I do not understand your question. Do you want a bat file that prompts the user for a file name and then delete's it?

    @echo off
    set /p filename=What file do you want to delete?
    echo Deleting %filename%
    del "%filename%"

    Sunday, July 7, 2019 4:08 PM