Discussion Locked

%username%

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can someone tell me how you can use %username% in a command line, or why it don't work.
Here is what I am trying to do. I want to delete a file with a batch file (login script on an NT4.0 server w/ 95 clients). The problem is, the file (destop shortcut) is in the persong profile directory. You cannot do a "cd c:\windows\profiles\%username%\desktop" and then delete the file.
I tried tried to run "for /r c:\ %i in (schedule.lnk) do del %i" but Win95 doesn't support the extra functionality (/r) of the for statement.

Any suggestions?

T.Buck.

3 replies

by frobo

Hi,

the environment Variable %username% or %Hostname% is only supported by Nt4.0 and w2k and not implemented in win95 by design !
Try to use Kix from the NT-Reskit to resolving such issues.

regards

Frobo

This discussion is closed to new replies.