• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

DOS Batch File Help

Hi

Im trying to launch a bat file which clears out a few files from the users terminal server windows directory but Im not sure how to acheive this. Each time the user logs on, I want the batch file to run, I can get the file to run but I cannot get the syntax right to delete the file.

I tried this but its ignoring the %user% bit

del "c:\documents and settings\%user%\windows\start.ini"

Any ideas guys?

DW
0
daiwhyte
Asked:
daiwhyte
1 Solution
 
LHT_STCommented:
change %user% to %username%

0
 
Steve KnightIT ConsultancyCommented:
If that is the user's profile directory too, you could use this in case something moves or is different for another user perhaps?

"%userprofile%\windows\start.ini"

I suggest you do this as one of the users run as "showme.cmd" or whatever from a logon script or cmd.exe etc.

@Echo off
set
pause

If one of the variables is showing nearer the correct path for your users then use that, otherwise try %userprofile% as above, then your hard coded path with %username% like LHT_ST suggested above.

Steve
0
 
daiwhyteAuthor Commented:
thank you
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now