Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2006
    Posts
    209

    Grin file.open not working

    hi guys.
    i have script on click and trying to open hosts file from this location.

    PHP Code:
    File.Open("C:\\WINXP\\system32\\drivers\\etc\\hosts"""SW_SHOWNORMAL); 
    but if i type this address in run c:\WINXP\system32\drivers\etc\hosts windows ask me with open to select some software to open this file (its just text file) so notepad is the best to open it.
    can i just simple specify to open this file in notepad?

  2. #2
    Join Date
    May 2005
    Posts
    1,115
    Try it like this:

    Code:
    File.Run("notepad.exe", "", _SystemFolder.."\\drivers\\etc\\hosts", SW_SHOWNORMAL, false);
    Never know what life is gonna throw at you.
    (Based on a true story.)

  3. #3
    Join Date
    Oct 2006
    Posts
    209

    Thumbs down no

    no its not working.
    PHP Code:
    File.Run("notepad.exe"""_SystemFolder.."\\drivers\\etc\\hosts"SW_SHOWNORMALfalse); 
    i checked hosts file is present.

  4. #4
    Join Date
    Oct 2006
    Posts
    209

    Smile this works

    sorry to bother you but here is i tested it works just have to specify temp working folder.
    PHP Code:
    File.Run("notepad.exe""c:\\WINXP\\system32\\drivers\\etc\\hosts""C:\\Temp"SW_SHOWNORMALtrue); 

  5. #5
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    By default, Windows XP is installed to C:\Windows so if you are going to run this application on other workstations it is best to take advantage of the built in variable '_SystemFolder'. There is also a variable for the users temporary folder called '_TempFolder'.

    Code:
    File.Run("notepad.exe", _SystemFolder.."\\drivers\\etc\\hosts", _TempFolder, SW_SHOWNORMAL, true);

  6. #6
    Join Date
    Oct 2006
    Posts
    209

    Cool actually here was i m trying

    thanks guys for help i was thinking about that but in this case what should i do?
    this code is for copy

    PHP Code:
    if e_Key == 13 then

    -- get input ip address from user
    DestFolder 
    Input.GetText("Input1");

    --
    progress bar
    StatusDlg
    .Show(MB_ICONNONEfalse);

    --
    code to copy file from location to destination 
    File
    .Copy("c:\\hosts"DestFolder.."\\C$\\winxp\\system32\\drivers\\etc\\hosts"truetruefalsetruenil);


    -- 
    Check to see if the File.Copy action failed by getting its error code.
    error Application.GetLastError();
    StatusDlg.Hide();

    -- If 
    it failed (not equal to 0), display a dialog informing the user.
    -- If 
    it succeededopen an explore window showing the "Copied Files" folder.
    if 
    error ~= 0 then
        result 
    Dialog.Message("Error""There was an error copying the files to your system. Please try again."MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);

    end

    end 
    for opening host file.

    PHP Code:
    DestFolder Input.GetText("Input1");
    File.Run("notepad.exe"DestFolder.."\\C$\\winxp\\system32\\drivers\\etc\\hosts""C:\\Temp"SW_SHOWNORMALtrue); 
    anc apz is attached with this post. can you please have look
    Attached Files

Similar Threads

  1. Loop not working
    By playmenow in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 04-12-2006, 08:48 AM
  2. Need help with File.Open on CDROM
    By Alan vanBiervliet in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 09-10-2005, 08:45 PM
  3. Working with Tables and Files
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 12-23-2003, 08:22 AM
  4. The ? char code is not working
    By Marker0077 in forum Setup Factory 6.0
    Replies: 7
    Last Post: 06-21-2003, 04:04 PM
  5. File - execute -> Working Directory
    By mtway in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 12-10-2002, 01:40 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