forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


path problem.....

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Sep 18, 2002 3:47 am    Post subject: path problem..... Reply with quote

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 Sad

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
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Wed Sep 18, 2002 4:22 am    Post subject: Reply with quote

@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
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Sep 18, 2002 4:30 am    Post subject: hummmm Reply with quote

ok BUT how i added that to what i have above? i guess i don't follow you to well Sad


thanks
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Wed Sep 18, 2002 4:45 am    Post subject: Reply with quote

Code:

if @file(@windir(S)"whatever")
   RUN @windir(S)"whatever"
   end
if @file(@windir(S)"whatever")
   RUN @windir(S)"whatever"
   end
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Sep 18, 2002 5:45 am    Post subject: Reply with quote

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
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Sep 18, 2002 6:06 am    Post subject: thanks Reply with quote

thanks guys i got it working Smile


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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group