You should be more detailed about your question. Are you working with which technology? What is your command line? What is the kind of your response variable?
Some ideas is to first specify your groups (case and control), quality check, perform HWE analysis, IBD analysis and run association test (logistic regression, maybe). You should take a better look at plink manual... It's actually very easy to understand. http://zzz.bwh.harvard.edu/plink/
You should enter your covariates in a .txt file. Subsequently you can perform logistic regression analysis using --logistic and --covar.
Regarding the error you get. I guess you don't have the permission to write in the current folder. Therefore it should probably be resolved if you set --out to a file prefix where you have the permission to write.
Hi Silvia Monge ..looks like your .ped file has a problem. Do you have any missing calls? Maybe filter your .ped file to remove any missing calls prior to converting it to a binary (.bed ) file. If you are using plink 1.9 try --missing command. This will give you a list of variants and a list of samples that have missing data. Remove these variants and samples from your .ped file and hopefully then you can convert it to a .bed file to extract your variants of interest. Hope this helps!