Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    201

    Need help with If then else statement Script

    Please can someone help me:
    Here what I want to do:

    search for C:\windows If found
    File.Copy("AutoPlay\\Docs\\file.txt", "C:\\windows\\", true, true, false, true, nil);
    else
    Search for D:\winodws folder If found
    File.Copy("AutoPlay\\Docs\\file.txt", "D:\\windows\\", true, true, false, true, nil);

    hope this is clear;


  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    if Folder.DoesExist("C:\\windows") then
    File.Copy("AutoPlay\\Docs\\file.txt", "C:\\windows\\", true, true, false, true, nil);
    elseif Folder.DoesExist("D:\\windows") then
    File.Copy("AutoPlay\\Docs\\file.txt", "D:\\windows\\", true, true, false, true, nil);
    end

    and what happens if neither are found?

    Hope that helps

    Yossi

  3. #3
    Join Date
    Mar 2006
    Posts
    61
    I think what he wants is to find the active Windows Folder.

    if (Folder.DoesExist(_WindowsFolder)) then
    File.Copy("AutoPlay\\Docs\\file.txt", _WindowsFolder, true, true, false, true, nil);
    end

    saves lines of not needed code. This will check and make sure that what ever drive you installed windows to that it's folder exits before it copies the file into it.

  4. #4
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    201
    Yosik Great Its working, Thank you for your help..
    if neither are found I did like this

    if Folder.DoesExist("C:\\test") then
    File.Copy("AutoPlay\\Docs\\file.txt", "C:\\test\\", true, true, false, true, nil);
    elseif Folder.DoesExist("D:\\test") then
    File.Copy("AutoPlay\\Docs\\file.txt", "D:\\test\\", true, true, false, true, nil);
    else
    Dialog.Message ("Error", "Ohh no...... Test Folder Does Not Exist ");
    end

    Is this this the correct way?

    Bags
    I havent tried your script yet, I will try that and let you know soon. Thanks

  5. #5
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    201
    Bags: your script dosent say which drive?
    I think yosik one is works fine so..

    Thanks for your reply too

Similar Threads

  1. .NET 1.1 Dependency Script Questions
    By drpepper in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-03-2006, 02:04 PM
  2. Script Editor Pane?
    By rraisley in forum AutoPlay Media Studio 6.0
    Replies: 18
    Last Post: 09-23-2005, 04:08 AM
  3. How can I know the FS Command name of a movie???
    By yoske in forum AutoPlay Media Studio 5.0
    Replies: 27
    Last Post: 01-01-2005, 10:39 PM
  4. IF Statement layout
    By Sooty in forum Setup Factory 6.0
    Replies: 0
    Last Post: 10-19-2004, 06:39 AM
  5. WHILE loop inside a IF/ENDIF statement???? Bug??
    By TJ_Tigger in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 04-27-2003, 07:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts