Announcement

Collapse
No announcement yet.

if then else syntax

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

  • if then else syntax

    Here is my code, I only want to copy the file if the registry key value is Surface

    startup_folder = Shell.GetFolder(SHF_STARTUP);
    StatusDlg.Show(MB_ICONNONE, false);
    -- Test to see if registry key is Surface, if so,copy the file
    IsSurface = Registry.GetValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFa mily ", "Surface", true);
    if IsSurface = Surface
    then
    File.Copy(SessionVar.Expand("%AppFolder%\\eSCOPE ELITE Pen.exe"), startup_folder, true, true, false, true, nil);
    else
    end
    result = File.Run(SessionVar.Expand("%AppFolder%\\Setup_You Tube.exe"), "", "", SW_SHOWNORMAL, true);
    File.Delete("C:\\atstemp\\*.*", true, false, true, nil);

  • #2
    I believe that this is what you wanted... I saw a few errors in the code, but this is untested script, so there might be still something I missed.

    Click image for larger version

Name:	SCRN-2020-11-12-03.png
Views:	48
Size:	11.3 KB
ID:	305717

    Ulrich

    Comment


    • #3
      Thank you once again, works perfectly

      Comment

      Working...
      X