Sign in to follow this  
Followers 0
dbecker

@WorkingDir script problem

9 posts in this topic

I'm trying to run a gui from a CD. the gui gives options for programs to install, the executables of which are in a directory on the cd, and will run the executables from the cd. I can make it run the executables from a specific drive letter, D:\ for example, but not every computer's cd drive will be labeled the D:\ drive. I saw that I could use @ScriptDir or @WorkingDir, but I can't seem to get either of them to work. anyone have any ideas?

Do
  $msg = GUIGetMsg ()

   Select
      Case $msg = $tab1XPPatch
     Run (@WorkingDir, "Ubertor Patch\XPPatch Installer.exe")
      Case $msg = $tab1Norton
         Run (@WorkingDir, "Ubertor Patch\Norton 10 Installer2.exe")
      Case $msg = $tab2MicrosoftASW
     Run (@WorkingDir, "Ubertor Patch\MicrosoftASW AutoInstaller.exe")
      Case $msg = $tab2AdAware
     Run (@WorkingDir, "Ubertor Patch\aawsepersonal.exe")
      Case $msg = $tab1CCAA
     Run (@WorkingDir, "Ubertor Patch\CCAA AutoInstaller.exe")
      Case $msg = $tab2Firefox
     Run (@WorkingDir, "Ubertor Patch\Firefox Setup.exe")
      Case $msg = $tab2Acrobat
     Run (@WorkingDir, "Ubertor Patch\AcrobatSetup.exe")
      Case $msg = $tab2Trillian
     Run (@WorkingDir, "Ubertor Patch\Trillian.exe")
      Case $msg = $tab2SpyBot
     Run (@WorkingDir, "Ubertor Patch\spybotsd14.exe")
      Case $msg = $tab1SP2
     Run (@WorkingDir, "Ubertor Patch\WindowsXP-KB835935.exe")
   EndSelect
Until

"I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements

Share this post


Link to post
Share on other sites



Look in the AutoIt BETA for DriveGetSize, DriveGetType, ETC.... you should be able to test for it.

Share this post


Link to post
Share on other sites

Look in the AutoIt BETA for DriveGetSize, DriveGetType, ETC.... you should be able to test for it.

could I use something like DriveGetLabel?

$var=DriveGetLabel (@WorkingDir)

"I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements

Share this post


Link to post
Share on other sites

Do
  $msg = GUIGetMsg ()

   Select
        Case $msg = $tab1XPPatch
        Run (@ScriptDir & "\Ubertor Patch\XPPatch Installer.exe")
        ...
        ...
   EndSelect
Until

Share this post


Link to post
Share on other sites

Do
  $msg = GUIGetMsg ()

   Select
        Case $msg = $tab1XPPatch
        Run (@ScriptDir & "\Ubertor Patch\XPPatch Installer.exe")
        ...
        ...
   EndSelect
Until
Thanks, MHz, that did the trick :P

"I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements

Share this post


Link to post
Share on other sites

Thanks, MHz, that did the trick :P

Your welcome. Glad it was just a simple fix to your Run() function. :lmao:

Share this post


Link to post
Share on other sites

Your welcome. Glad it was just a simple fix to your Run() function. :P

definitely. what would be the difference in functionality/advantage in using @WorkingDir and @ScriptDir?


"I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements

Share this post


Link to post
Share on other sites

definitely. what would be the difference in functionality/advantage in using @WorkingDir and @ScriptDir?

@WorkingDir can change. @ScriptDir is where your script is.

If the script is at

C:\ScriptDir_Folder

and I want to reference files here.

C:\ScriptDir_Folder\Folder_B

I could use

FileChangeDir(@ScriptDir & '\Folder_B')

Now the script can work relative to Folder_B as it is the new working directory set.

A file in Folder_B can be now accessed like:

Run(@WorkingDir & '\yourfile.exe')

or just relative

Run('yourfile.exe')

Share this post


Link to post
Share on other sites

ahhh.. excellent. thanks a lot... that defitely makes a lot more sense now.


"I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0