Help to delete pwl files 
Author Message
 Help to delete pwl files

I have a program I am writing that allows a user to logout, then I want to
capture the user name from the registry and use that name to delete their
pwl file.

I want to kill c:\windows\CurUser.pwl

I can get it to echo me the correct curent user to a msgbox, so I know I am
getting the right value assigned to CurUser.  I am just braindead today on
the right format.

Thanks,
Joe



Wed, 18 Jun 1902 08:00:00 GMT  
 Help to delete pwl files



| I have a program I am writing that allows a user to logout, then I want to
| capture the user name from the registry and use that name to delete their
| pwl file.
|
| I want to kill c:\windows\CurUser.pwl

Kill "c:\windows\" & CurUser & ".pwl"

|
| I can get it to echo me the correct curent user to a msgbox, so I know I
am
| getting the right value assigned to CurUser.  I am just braindead today on
| the right format.
|
| Thanks,
| Joe
|
|



Wed, 18 Jun 1902 08:00:00 GMT  
 Help to delete pwl files
I tried that, but all I get back c:\windows\jsmith.  The .pwl does not get
added.  Its like any string I place to the right is lost.

Here is the code

  'Reads User Name
Dim s As String
Dim cnt As Long
Dim dl As Long
Dim CurUser As String
cnt = 199
s = String$(200, 0)
dl = GetUserName(s, cnt)
If dl <> 0 Then CurUser = Left$(s, cnt) Else CurUser = ""

'Deletes user pwl file

MsgBox CurUser     ' CurUser value returns correct
Kill "C:\windows\" & CurUser & ".pwl"      ' This is the trouble spot
'  Kill not working

Thanks
Joe


Quote:



> | I have a program I am writing that allows a user to logout, then I want
to
> | capture the user name from the registry and use that name to delete
their
> | pwl file.
> |
> | I want to kill c:\windows\CurUser.pwl

> Kill "c:\windows\" & CurUser & ".pwl"

> |
> | I can get it to echo me the correct curent user to a msgbox, so I know I
> am
> | getting the right value assigned to CurUser.  I am just braindead today
on
> | the right format.
> |
> | Thanks,
> | Joe
> |
> |



Wed, 18 Jun 1902 08:00:00 GMT  
 Help to delete pwl files
Joe,

The problem is not killing the file, but the getting the username.
GetUserName puts a null-terminated string in the buffervariable. When the
username is "jsmith", is provides you with a 7-character long string holding
"jsmith|" (| is the null-character).
You have to change the line where you 'translate' the result op the API call
to your variable like:

If dl <> 0 Then CurUser = Left$(s, cnt - 1) Else CurUser = ""

Hope this helps,
Johan.



| I tried that, but all I get back c:\windows\jsmith.  The .pwl does not get
| added.  Its like any string I place to the right is lost.
|
| Here is the code
|
|   'Reads User Name
| Dim s As String
| Dim cnt As Long
| Dim dl As Long
| Dim CurUser As String
| cnt = 199
| s = String$(200, 0)
| dl = GetUserName(s, cnt)
| If dl <> 0 Then CurUser = Left$(s, cnt) Else CurUser = ""
|
|
| 'Deletes user pwl file
|
| MsgBox CurUser     ' CurUser value returns correct
| Kill "C:\windows\" & CurUser & ".pwl"      ' This is the trouble spot
| '  Kill not working
|
| Thanks
| Joe
|
|


| >


| > | I have a program I am writing that allows a user to logout, then I
want
| to
| > | capture the user name from the registry and use that name to delete
| their
| > | pwl file.
| > |
| > | I want to kill c:\windows\CurUser.pwl
| >
| > Kill "c:\windows\" & CurUser & ".pwl"
| >
| > |
| > | I can get it to echo me the correct curent user to a msgbox, so I know
I
| > am
| > | getting the right value assigned to CurUser.  I am just braindead
today
| on
| > | the right format.
| > |
| > | Thanks,
| > | Joe
| > |
| > |
| >
| >
|
|



Wed, 18 Jun 1902 08:00:00 GMT  
 Help to delete pwl files


Wed, 18 Jun 1902 08:00:00 GMT  
 Help to delete pwl files
That did the trick!! Thanks


Quote:
> Joe,

> The problem is not killing the file, but the getting the username.
> GetUserName puts a null-terminated string in the buffervariable. When the
> username is "jsmith", is provides you with a 7-character long string
holding
> "jsmith|" (| is the null-character).
> You have to change the line where you 'translate' the result op the API
call
> to your variable like:

> If dl <> 0 Then CurUser = Left$(s, cnt - 1) Else CurUser = ""

> Hope this helps,
> Johan.



> | I tried that, but all I get back c:\windows\jsmith.  The .pwl does not
get
> | added.  Its like any string I place to the right is lost.
> |
> | Here is the code
> |
> |   'Reads User Name
> | Dim s As String
> | Dim cnt As Long
> | Dim dl As Long
> | Dim CurUser As String
> | cnt = 199
> | s = String$(200, 0)
> | dl = GetUserName(s, cnt)
> | If dl <> 0 Then CurUser = Left$(s, cnt) Else CurUser = ""
> |
> |
> | 'Deletes user pwl file
> |
> | MsgBox CurUser     ' CurUser value returns correct
> | Kill "C:\windows\" & CurUser & ".pwl"      ' This is the trouble spot
> | '  Kill not working
> |
> | Thanks
> | Joe
> |
> |


> | >


> | > | I have a program I am writing that allows a user to logout, then I
> want
> | to
> | > | capture the user name from the registry and use that name to delete
> | their
> | > | pwl file.
> | > |
> | > | I want to kill c:\windows\CurUser.pwl
> | >
> | > Kill "c:\windows\" & CurUser & ".pwl"
> | >
> | > |
> | > | I can get it to echo me the correct curent user to a msgbox, so I
know
> I
> | > am
> | > | getting the right value assigned to CurUser.  I am just braindead
> today
> | on
> | > | the right format.
> | > |
> | > | Thanks,
> | > | Joe
> | > |
> | > |
> | >
> | >
> |
> |



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. *** parsing PWL files *** plz help

2. PWL files

3. PWL files

4. Password decoded from pwl file

5. PWL files?

6. pwl files

7. pwl files

8. How to open a .PWL file?

9. How to open .PWL file?

10. pwl files

11. How to set a RAS password in the PWL file

12. Functions concerning PWL files

 

 
Powered by phpBB® Forum Software