Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Windows: Shortcut to scripts

 [1/7] from: robert:muench:robertmuench at: 5-Oct-2001 10:13


Hi, I'm tyring to use Windows' linking feature to create a shortcut to a script and specifying a directory the script should be executed in. I want to use this because the file-request should display the "start in directory" contents. But this doesn't work, instead the file-requester displays the contents of the directory where the script is in. Any idea? Robert

 [2/7] from: greggirwin:starband at: 5-Oct-2001 11:25


Hi Robert, << I'm tyring to use Windows' linking feature to create a shortcut to a script and specifying a directory the script should be executed in. I want to use this because the file-request should display the "start in directory" contents. But this doesn't work, instead the file-requester displays the contents of the directory where the script is in. Any idea? >> I'm not clear on how you're attacking the problem. Are you trying to create a lnk file yourself, or are you trying to emulate Windows shortcuts with pure REBOL? Having not tried this, would it work to use change-dir to set the working directory and then execute the script with a fully qualified path, or is that what you're doing now? --Gregg

 [3/7] from: robert::muench::robertmuench::de at: 6-Oct-2001 10:27


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
<<quoted lines omitted: 5>>
> a lnk file yourself, or are you trying to emulate Windows shortcuts with pure > REBOL?
Hi, well simple things should be explained the simple way ;-). I'm trying to create a LNK file with the normal Windows process.
> Having not tried this, would it work to use change-dir to set the working > directory and then execute the script with a fully qualified path, or is that
what
> you're doing now?
Hm, this would be a work around, a Rebol wrapper file... But I'm not sure why the normal Windows LNK way doesn't work. It could be that the Rebol interpreter doesn't use the information about the start-in directory from the environment. Robert

 [4/7] from: greggirwin:starband at: 6-Oct-2001 12:09


Hi Robert, << I'm trying to create a LNK file with the normal Windows process. But I'm not sure why the normal Windows LNK way doesn't work. It could be that the Rebol interpreter doesn't use the information about the start-in directory from the environment. >> I don't know either. Maybe REBOL changes to the scripts directory itself. As another workaround, you could add the working directory to the Target of the shortcut: C:\Rebol\rebol.exe c:\rebol\gregg\read-cur-dir.r //rebol and then in your script you could change directories yourself: change-dir to-file dirize system/script/args Not what I would call elegant, but not too painful either. --Gregg

 [5/7] from: robert:muench:robertmuench at: 8-Oct-2001 12:12


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
<<quoted lines omitted: 9>>
> change-dir to-file dirize system/script/args > Not what I would call elegant, but not too painful either.
Hi, well why not ;-). Just to be sure I understand it correctly. I'm adding the start-in directory as script-argument, right? So I have: rebol.exe script arguments Hm... I'm going to try it out. Robert

 [6/7] from: greggirwin:starband at: 8-Oct-2001 9:58


Hi Robert, << Just to be sure I understand it correctly. I'm adding the start-in directory as script-argument, right? So I have: rebol.exe script arguments
>>
Correct. --Gregg

 [7/7] from: robert:muench:robertmuench at: 9-Oct-2001 19:34


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
<<quoted lines omitted: 6>>
> >> > Correct.
Hi, there was only one quirk. It's much better to use system/options/args than system/script/args, as the first returns a block of the parameters given. Than it's easy to check if the first parameter is a directory and make a change-dir. Otherwise you would have to handle a string. Robert

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted