1

I have converted a batch file to exe. My problem is that all virusprograms think this is a "trojan attack" and delete the file. Is there a quickfix for this? Reason for not using the original batch file is that Users of the file forgets the "run as administrator" and with the exe I can force it.

@echo off
%~d0\bat\menu.bat
Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
  • 4
    The AV programs are correct. Any exe that elevates privilege for itself is potentially a Trojan. And any "quick fix" would represent an unacceptable security flaw. – Stephen C May 29 '15 at 13:32
  • cant you create a shortcut with 'run as administrator' thick? – npocmaka May 29 '15 at 13:35
  • 1
    See also this: http://superuser.com/questions/604927/how-do-i-configure-my-application-to-run-as-administrator-automatically – Stephen C May 29 '15 at 13:37
  • See also this: https://sites.google.com/site/eneerge/scripts/batchgotadmin And this: http://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file – rojo May 29 '15 at 13:50
  • I can not run from shortcut because drive will be random. '%~d0\' does not work in a shortcut. the bacth is placed in a usbdrive – Stian Størstfeskar Andersen May 29 '15 at 14:54

1 Answers1

0

You could create a shortcut with admin prompt and run it. This is using the shortcut.exe file from this site. I haven't actually tested this code.

shortcut -f -t runas /user:%computername%\administrator %cd%\batchfile.bat -n %cd%\startfile
start %cd%\startfile.lnk
Script_Coded
  • 709
  • 8
  • 21