Page 1 of 1 1
Topic Options
#14070 - 2001-11-09 11:36 AM Path not found...?
Anonymous
Unregistered


I want to check if a dir exist, and if not, that dir must be made. I use the following code:
code:
$favLocalDir  = "%username%\Favorites\JMI Favorieten"
If Exist($favLocalDir) = 0
Md $favLocalDir
EndIf


At the line Md $favLocalDir there's an error 3 stating that "The system cannot find the path specified".

I don't get it

Top
#14071 - 2001-11-09 01:11 PM Re: Path not found...?
Anonymous
Unregistered


I don't see a drive letter in your script. Maybe "f:\%username%\...."?
Top
#14072 - 2001-11-09 01:25 PM Re: Path not found...?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
MD will only make one level of directory.

If the %username% directory or the %username\Favorites directory are missing it cannot create them.

Top
#14073 - 2001-11-09 02:45 PM Re: Path not found...?
Anonymous
Unregistered


Fozzel,

it's a directory on the local PC, so %username% points to "c:\documents and settings\username", therefore a drivemapping is not necessary.

Top
#14074 - 2001-11-09 02:48 PM Re: Path not found...?
Anonymous
Unregistered


Richard,

Both directories exist. I'm using Win2k, so both dirs are made when you logon for the first time. So, I don't get why this is not gonna working.

Anyone ideas?

Top
#14075 - 2001-11-09 04:18 PM Re: Path not found...?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Martijn,

Try %UserProfile% instead !
%username% is ie. "jpols"
%userprofile% is "c:\documents and settings\jpols"

stwh !

Jochen

_________________________



Top
#14076 - 2001-11-09 04:22 PM Re: Path not found...?
Anonymous
Unregistered


Of course Jochen! That's it, it's maybe time for the weekend...

Thanks!

Top
#14077 - 2001-11-12 07:16 AM Re: Path not found...?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

The most accurate value you will get from your registry.
No dependence of an environment variable.
Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#14078 - 2001-11-12 10:24 AM Re: Path not found...?
Anonymous
Unregistered


MCA,

What is the key where these settings are stored?

(postnr. 100)

[ 12 November 2001: Message edited by: MartijnL ]

Top
#14079 - 2001-11-12 04:01 PM Re: Path not found...?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Martijnl,

Current User common folders that MCA is referring to:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

All users:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Shell Folders

These are pretty universial between all flavors of Windows.

HTH,

- Kent

[ 12 November 2001: Message edited by: kdyer ]

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.064 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org