| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Sep 18, 2002 3:47 am Post subject: path problem..... |
|
|
hello all how can i make it so i don't have to hard code the "c" in there cuase my other computer uses g for drive
| Code: |
if @file("c:\windows\system\whatever")
RUN "c:\windows\system\whatever"
end
if @file("c:\windows\system32\whatever")
RUN "c:\windows\system32\whatever"
end
|
i want it so C can be what the user has THERE drive letter
thanks
i hope you follow what i mean |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Sep 18, 2002 4:22 am Post subject: |
|
|
@windir() returns the Windows directory
@windir(S) returns the Windows/System (System32 on NT) directory
@windir(T) returns the Windows/Temp directory
Use that and it will return the full path to those directories.
You can also use other path returning variables/functions:
@curdir() returns the current directory
@path(%0) returns the directory that you're exe is in |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Sep 18, 2002 4:30 am Post subject: hummmm |
|
|
ok BUT how i added that to what i have above? i guess i don't follow you to well
thanks |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Sep 18, 2002 4:45 am Post subject: |
|
|
| Code: |
if @file(@windir(S)"whatever")
RUN @windir(S)"whatever"
end
if @file(@windir(S)"whatever")
RUN @windir(S)"whatever"
end
|
|
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Sep 18, 2002 5:45 am Post subject: |
|
|
Be aware, though, that @windir(T) returns a path with a trailing backslash, for instance C:\Windows\Temp\
@windir() and @windir(S) return no trailing backslash, for example C:\Windows\System
So actually PGWARE's example should probably be:
| Code: | if @file(@windir(S)\"somefile.ext")
run @windir(S)\"somefile.ext"
end |
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Sep 18, 2002 6:06 am Post subject: thanks |
|
|
thanks guys i got it working
btw i didn't need that all the code that i posted becuase the "new" way i don't need the if statement in there  |
|
| Back to top |
|
 |
|