| View previous topic :: View next topic |
| Author |
Message |
sleepyy35
Joined: 22 Jul 2004 Posts: 194 Location: cedar city UT
|
Posted: Thu Jul 22, 2004 6:44 am Post subject: help me please :) |
|
|
how would you script = FileDelete, C:\temp files\*.tmp
in xp EXAMPLE say you would like to delete your temp files in
xp it would C:\Documents and Settings not c:\temp yes ! i could fill in the path but that would be only good on my pc is there a way around that so others could use my script
C:\Documents and Settings\michael\Local Settings\temp
see the script would only be good on my pc how could i leave the michael out and when someone runs it it would use there name ??? _________________ ^sleepy^ |
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 182
|
Posted: Thu Jul 22, 2004 7:25 am Post subject: |
|
|
There are environment variables already set on each PC which could be used within an AHKScript e.g.
| Quote: | USERPROFILE=C:\Documents and Settings\michael
TEMP=C:\DOCUME~1\michael\LOCALS~1\Temp
TMP=C:\DOCUME~1\michael\LOCALS~1\Temp |
The Temp variables could be missing, check this out at your command line:
To solve your issue:
| Quote: | MsgBox, %TEMP%\*.tmp ; only for testing
FileDelete, %TEMP%\*.tmp
MsgBox, %TMP%\*.tmp ; only for testing
FileDelete, %TMP%\*.tmp
MsgBox, %USERPROFILE%\Local Settings\temp\*.tmp ; only for testing
FileDelete, %USERPROFILE%\Local Settings\temp\*.tmp
|
|
|
| Back to top |
|
 |
sleepyy35
Joined: 22 Jul 2004 Posts: 194 Location: cedar city UT
|
Posted: Thu Jul 22, 2004 7:28 am Post subject: :) |
|
|
ok i will work with that
thanx so much Beastmaster  _________________ ^sleepy^ |
|
| Back to top |
|
 |
|