Announcement

Collapse
No announcement yet.

Pass !define to nsexec cmd.exe

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • StealUrKill_PhD
    replied
    I actually tried that first and did not seem to work. I guess I should have stated that as well. I might have typed something wrong and did not notice it. I will setup another test and see. Thanks.

    Leave a comment:


  • Anders
    replied
    You don't need to copy it to a variable, just do ...\Desktop\${File_Name}"' /f /s

    Leave a comment:


  • StealUrKill_PhD
    replied
    I was able to figure it out, thanks.

    I am using the define due to me using it under
    Name
    OutFile

    PHP Code:
    !define File_Name "test.exe"
    Var /Global APPNAME

    Function .onInit
        StrCpy $APPNAME 
    ${File_Name}
        
    nsExec::Exec '"$sysdir\cmd.exe" /c if 1==1 del "%userprofile%\Desktop\$APPNAME"' //s
    FunctionEnd 

    Leave a comment:


  • Anders
    replied
    You need to learn the difference between a $variable and a ${define}.

    Leave a comment:


  • StealUrKill_PhD
    started a topic Pass !define to nsexec cmd.exe

    Pass !define to nsexec cmd.exe

    Is is possible to pass from nsis to cmd.exe?

    I can manually type it in but it will change everytime its compiled again.


    PHP Code:
    !define File_Name "test.exe"

    Function .onInit
        nsExec
    ::Exec '"$sysdir\cmd.exe" /c if 1==1 del "%userprofile%\Desktop\$File_Name"' //s
    FunctionEnd 
Working...
X