Sign in to follow this  
Followers 0
viriiman

Noob question about changing directories

22 posts in this topic

So I've written three seperate autoit scripts to install three seperate programs from my pen drive. They all run without a problem, but I'm looking to tie them all together.

The problem is I have no idea how to do so. Would I leave them as three seperate scripts and call them one at a time, or would I just write one script that includes them all?

My directory structure is:

\ (Main folder where subfolders w/ files in them live)

...\3rd_party\bsi\old version

...\3rd_party\Extra

I can't use a static drive letter because that may change, and I don't want to have to enter in the drive letter manually.

I've searched around and found that I probably need to use the "FileChangeDir" command, but I have no idea how to use it.

TIA

viriiman

Share this post


Link to post
Share on other sites



If the scripts run from the pendrive then you just don't use a drive letter on the source, and the destination would be C: (the local driver).

Something like DirCopy ("mydir\mysubdir", "C:\program files\mysubdir");


[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Use relative path from @ScriptDir instead.

Edited by Joon

Share this post


Link to post
Share on other sites

If the scripts run from the pendrive then you just don't use a drive letter on the source, and the destination would be C: (the local driver).

Something like DirCopy ("mydir\mysubdir", "C:\program files\mysubdir");

I don't want to copy the install to the local drive, as I don't want the users to have access to the install.

Use relative path from @ScriptDir instead.

I have no idea what this means (sorry, still learning)

To also give an update. Like I mentioned, there are three scripts:

1) (lives in the root of the folder structure) eg (whateverishere)\autoitscript.exe

2) (whateverishere)\3rd_party\bsi\old version\autoitscript.exe

3) (whateverishere)\3rd_party\Extra\autoitscript.exe

(Just in case the question comes up, I do have the original au3 files )

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Put this in main AutoIt program that in root directory.

Run(@ScriptDir & "\3rd_party\bsi\old version\autoitscript.exe")
Run(@ScriptDir & "\3rd_party\Extra\autoitscript.exe")
Edited by Joon

Share this post


Link to post
Share on other sites

Put this in main AutoIt program that in root directory.

Run(@ScriptDir & "\3rd_party\bsi\old version\autoitscript.exe")
Run(@ScriptDir & "\3rd_party\Extra\autoitscript.exe")

Will it wait for the previous script to finish before it calls the new one?

Share this post


Link to post
Share on other sites

Will it wait for the previous script to finish before it calls the new one?

Then you need to use RunWait.

Share this post


Link to post
Share on other sites

Then you need to use RunWait.

How?

(again, I'm sorry for so many followup posts).

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

AutoIt has very good help file.

RunWait(@ScriptDir & "\3rd_party\bsi\old version\autoitscript.exe")
RunWait(@ScriptDir & "\3rd_party\Extra\autoitscript.exe")

I know, and I'm sorry I didn't read into the command. Thank you though, for putting up with me and my questions, it's greatly appreciated.

I do have one other one, but I'll post a new thread about it.

THANKS!

Edited by viriiman

Share this post


Link to post
Share on other sites

$MyDriveLetter = StringLeft (@ScriptDir, 1)

This will get the first letter from the script full path.

If the script path is J:\Dir1\SubDir1\SubDir2\script.exe, $MyDriveLetter will be J.


[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites

The fact that this guy calls himself "viriiman" and the fact that he's asking for help with a script that he can run from a pen drive combine to suggest that he's writing a virus that he can install on someone else's computer by plugging in his pen drive.

This is not exactly something that's going to enhance AutoIt's reputation.

Share this post


Link to post
Share on other sites

The fact that this guy calls himself "viriiman" and the fact that he's asking for help with a script that he can run from a pen drive combine to suggest that he's writing a virus that he can install on someone else's computer by plugging in his pen drive.

This is not exactly something that's going to enhance AutoIt's reputation.

Ahh .. the famous " Guilty until proven innocent" ... :) or did I get that backwards ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

[/flame]

Just report the topic to a moderator if you think it's suspicious.

EDIT: JdeB posted before me.

Edited by CoePSX

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

The fact that this guy calls himself "viriiman" and the fact that he's asking for help with a script that he can run from a pen drive combine to suggest that he's writing a virus that he can install on someone else's computer by plugging in his pen drive.

This is not exactly something that's going to enhance AutoIt's reputation.

What made you think that viriiman is making AutoIt to spread the virus???

Edited by Joon

Share this post


Link to post
Share on other sites

What made you think that viriiman is making AutoIt to spread the virus???

...um, the first sentence of the first post on this thread says more or less exactly that.

Share this post


Link to post
Share on other sites

...um, the first sentence of the first post on this thread says more or less exactly that.

Maybe have a second glance at it and then explain how so ?

I read that somebody has a MemKey from which he wants to install software ....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Maybe have a second glance at it and then explain how so ?

I read that somebody has a MemKey from which he wants to install software ....

Correct. I posted the code in another thread to all to see. It starts on on a pen drive, until I MANUALLY copy it over to a server (who's path and drive letter changes based on location) and run it from there.

The whole issue I have is that (again) none of the paths are the same from office to office. So I needed some way to run the script regardless of drive letter and path to the folder.

Sorry if I'm beating a dead horse, but I want to make it 1000% clear that this is not malware related.

Share this post


Link to post
Share on other sites

Is this the thread you're talking about?

http://www.autoitscript.com/forum/index.php?showtopic=39344

No ... clear ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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