%username% - TechRepublic
General discussion
April 27, 2001 at 06:07 AM
darthbuck

%username%

by darthbuck . Updated 25 years ago

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.

This discussion is locked

All Comments