Link to home
Start Free TrialLog in
Avatar of daiwhyte
daiwhyteFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of LHT_ST
LHT_ST

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve Knight
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
Avatar of daiwhyte

ASKER

thank you