If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#31
|
|||
|
|||
Creating a .bat file?
Adding to what John here said, "rd" stands for remove directory, Kate.
Another good and powerful command is "deltree" - just be very careful if and when you use it. Deltree deletes everything in the directory, even if its not empty, which I don't think "rd" will do. You can look it up on the net. John John - MVP wrote: Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
Ads |
#32
|
|||
|
|||
Creating a .bat file?
Bill in Co. wrote:
Deltree deletes everything in the directory, even if its not empty, which I don't think "rd" will do. That is what the /s switch is for. Do rd /? John |
#33
|
|||
|
|||
Creating a .bat file?
Oh, ok.
Haven't used rd in ages, but have used deltree somewhat recently. John John - MVP wrote: Bill in Co. wrote: Deltree deletes everything in the directory, even if its not empty, which I don't think "rd" will do. That is what the /s switch is for. Do rd /? John |
#34
|
|||
|
|||
Creating a .bat file?
Deltree is not available in XP Home, unless you got it from somewhere else?
-- SC Tom "Bill in Co." wrote in message ... Oh, ok. Haven't used rd in ages, but have used deltree somewhat recently. John John - MVP wrote: Bill in Co. wrote: Deltree deletes everything in the directory, even if its not empty, which I don't think "rd" will do. That is what the /s switch is for. Do rd /? John |
#35
|
|||
|
|||
Creating a .bat file?
As you will see in my reply to John, "rd" removed the folder, so I
assume its contents were also deleted. They are not in the Cookies folder, anyway. Re the deltree command, I really would prefer to avoid using it because of all the dread warnings years ago about deltree y (see my earlier post about Win98). Kate "Bill in Co." wrote in message ... Adding to what John here said, "rd" stands for remove directory, Kate. Another good and powerful command is "deltree" - just be very careful if and when you use it. Deltree deletes everything in the directory, even if its not empty, which I don't think "rd" will do. You can look it up on the net. John John - MVP wrote: Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
#36
|
|||
|
|||
Creating a .bat file?
Thank you very much once again, John. Works a treat.
Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
#37
|
|||
|
|||
Creating a .bat file?
You're welcome. By the % they meant that you can use variables in the
batch file. For more information open a command prompt and issue the SET command and you will see some of the variables. While at the command prompt you can experiment with the CD command and see the results: cd \ cd %userprofile% cd %systemroot% cd %appdata% cd %windir% Someone writing a batch file for use on other people's computer wouldn't know their user names or profile folder path so they would use the variable to make sure that the command runs properly: echo %userprofile%\cookies The cd and echo commands work even if there are spaces in the path but most other commands still need to use "quotation marks" to ensure that the command runs properly, for example the MD (Make Directory) command without quotation marks: md %userprofile\TestFolder will have unexpected results, there will be no TestFolder in the expected user folder at C:\Documents and Settings but there will be several new folders in the root of the c: drive, to run properly the command needs quotation marks: md "%userprofile\TestFolder" John Kate wrote: Thank you very much once again, John. Works a treat. Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
#38
|
|||
|
|||
Creating a .bat file?
SC Tom wrote:
Deltree is not available in XP Home, unless you got it from somewhere else? It doesn't seem to be available in XP Pro either, at least on my machine. No matter, rd /s works just fine, if needed. Bill |
#39
|
|||
|
|||
Creating a .bat file?
It's on my DOS flash disk, where I had been using it. Now that you mention
it, I guess it would be useless on XP with NTFS. My Bad. SC Tom wrote: Deltree is not available in XP Home, unless you got it from somewhere else? -- SC Tom "Bill in Co." wrote in message ... Oh, ok. Haven't used rd in ages, but have used deltree somewhat recently. John John - MVP wrote: Bill in Co. wrote: Deltree deletes everything in the directory, even if its not empty, which I don't think "rd" will do. That is what the /s switch is for. Do rd /? John |
#40
|
|||
|
|||
Creating a .bat file?
Thank you for the explanations, John.
I see that one of your examples uses "echo". I used the echo /? command to find out more, but all that was mentioned was echo on and echo off, not what it actually does. Another user of the program that creates all the unwanted temp files has written a batch file but for Win 4NT, and I gather that the wording will be different to a batch file for Win XP. He has written his .bat so that, 30 seconds after he closes the program, the rest of the batch file will run automatically and clean up the temp files. The entries he has written are : @echo off "C:\Program Files\DxO Labs\DxO Optics Pro v6\DxOOpticsPro6.exe" delay 30 followed by the del instructions. Will these three lines as written work for the batch file you have helped me with, please? I ran a @ /? command but the details said it was not recognised, so I am reluctant to experiment and add these lines to my .bat without advice in case something goes very wrong. Thanks Kate "John John - MVP" wrote in message ... You're welcome. By the % they meant that you can use variables in the batch file. For more information open a command prompt and issue the SET command and you will see some of the variables. While at the command prompt you can experiment with the CD command and see the results: cd \ cd %userprofile% cd %systemroot% cd %appdata% cd %windir% Someone writing a batch file for use on other people's computer wouldn't know their user names or profile folder path so they would use the variable to make sure that the command runs properly: echo %userprofile%\cookies The cd and echo commands work even if there are spaces in the path but most other commands still need to use "quotation marks" to ensure that the command runs properly, for example the MD (Make Directory) command without quotation marks: md %userprofile\TestFolder will have unexpected results, there will be no TestFolder in the expected user folder at C:\Documents and Settings but there will be several new folders in the root of the c: drive, to run properly the command needs quotation marks: md "%userprofile\TestFolder" John Kate wrote: Thank you very much once again, John. Works a treat. Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
#41
|
|||
|
|||
Creating a .bat file?
It echoes... try these:
echo Merry Christmas echo Kate echo Merry Christmas %username%! These user variables continue to be in place in all NT versions, some of them were probably in place in Windows 3.x and Windows 95, the 'ol' pros would know this... Batches written for NT4 will run on XP as long as they are not trying to execute unknown or forbidden commands, and vice-versa. If you want help with the batch file you need to reveal more of its contents or you should reveal the source of the file. 'Delay' is not a valid Windows command, this is probably just pinging the loopback adapter for 30 seconds. Try this inoffensive command: ping google.com now get your stopwatch and time this: ping google.com -n 29 John Kate wrote: Thank you for the explanations, John. I see that one of your examples uses "echo". I used the echo /? command to find out more, but all that was mentioned was echo on and echo off, not what it actually does. Another user of the program that creates all the unwanted temp files has written a batch file but for Win 4NT, and I gather that the wording will be different to a batch file for Win XP. He has written his .bat so that, 30 seconds after he closes the program, the rest of the batch file will run automatically and clean up the temp files. The entries he has written are : @echo off "C:\Program Files\DxO Labs\DxO Optics Pro v6\DxOOpticsPro6.exe" delay 30 followed by the del instructions. Will these three lines as written work for the batch file you have helped me with, please? I ran a @ /? command but the details said it was not recognised, so I am reluctant to experiment and add these lines to my .bat without advice in case something goes very wrong. Thanks Kate "John John - MVP" wrote in message ... You're welcome. By the % they meant that you can use variables in the batch file. For more information open a command prompt and issue the SET command and you will see some of the variables. While at the command prompt you can experiment with the CD command and see the results: cd \ cd %userprofile% cd %systemroot% cd %appdata% cd %windir% Someone writing a batch file for use on other people's computer wouldn't know their user names or profile folder path so they would use the variable to make sure that the command runs properly: echo %userprofile%\cookies The cd and echo commands work even if there are spaces in the path but most other commands still need to use "quotation marks" to ensure that the command runs properly, for example the MD (Make Directory) command without quotation marks: md %userprofile\TestFolder will have unexpected results, there will be no TestFolder in the expected user folder at C:\Documents and Settings but there will be several new folders in the root of the c: drive, to run properly the command needs quotation marks: md "%userprofile\TestFolder" John Kate wrote: Thank you very much once again, John. Works a treat. Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
#42
|
|||
|
|||
Creating a .bat file?
That was interesting!
The batch file I mentioned was written so that the application could be launched by double-clicking the .btm (in his case), then after 30 seconds, the temp files would be deleted, although the application would still be running (I think!). However, I don`t think it is worth going any further with this after all, as it is no big thing to just dbl-click the batch I have at the moment and clear the files after I close the app. With thanks and best wishes for Christmas and 2010 Kate "John John - MVP" wrote in message ... It echoes... try these: echo Merry Christmas echo Kate echo Merry Christmas %username%! These user variables continue to be in place in all NT versions, some of them were probably in place in Windows 3.x and Windows 95, the 'ol' pros would know this... Batches written for NT4 will run on XP as long as they are not trying to execute unknown or forbidden commands, and vice-versa. If you want help with the batch file you need to reveal more of its contents or you should reveal the source of the file. 'Delay' is not a valid Windows command, this is probably just pinging the loopback adapter for 30 seconds. Try this inoffensive command: ping google.com now get your stopwatch and time this: ping google.com -n 29 John Kate wrote: Thank you for the explanations, John. I see that one of your examples uses "echo". I used the echo /? command to find out more, but all that was mentioned was echo on and echo off, not what it actually does. Another user of the program that creates all the unwanted temp files has written a batch file but for Win 4NT, and I gather that the wording will be different to a batch file for Win XP. He has written his .bat so that, 30 seconds after he closes the program, the rest of the batch file will run automatically and clean up the temp files. The entries he has written are : @echo off "C:\Program Files\DxO Labs\DxO Optics Pro v6\DxOOpticsPro6.exe" delay 30 followed by the del instructions. Will these three lines as written work for the batch file you have helped me with, please? I ran a @ /? command but the details said it was not recognised, so I am reluctant to experiment and add these lines to my .bat without advice in case something goes very wrong. Thanks Kate "John John - MVP" wrote in message ... You're welcome. By the % they meant that you can use variables in the batch file. For more information open a command prompt and issue the SET command and you will see some of the variables. While at the command prompt you can experiment with the CD command and see the results: cd \ cd %userprofile% cd %systemroot% cd %appdata% cd %windir% Someone writing a batch file for use on other people's computer wouldn't know their user names or profile folder path so they would use the variable to make sure that the command runs properly: echo %userprofile%\cookies The cd and echo commands work even if there are spaces in the path but most other commands still need to use "quotation marks" to ensure that the command runs properly, for example the MD (Make Directory) command without quotation marks: md %userprofile\TestFolder will have unexpected results, there will be no TestFolder in the expected user folder at C:\Documents and Settings but there will be several new folders in the root of the c: drive, to run properly the command needs quotation marks: md "%userprofile\TestFolder" John Kate wrote: Thank you very much once again, John. Works a treat. Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate "Bill Sharpe" wrote in message .. . Leonard Grey wrote: While this thread has been going on I have cleaned out my temp folders 142 times. --- Surely you jest, Leonard! The thread's just 24 hours old. Kate's right. You could use a batch file... Bill |
#43
|
|||
|
|||
Creating a .bat file?
"Kate" wrote in message
... Thank you very much once again, John. Works a treat. Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate Hi Kate, Yes, the % sign is used in environment variables. You could use something like this in your batch file: del /Q "%UserProfile%\Local Settings\Temp\PTM*.tmp" del /Q "%UserProfile%\Local Settings\Temp\t*.tmp" This works the same on my system: del /Q "%Temp%\PTM*.tmp" del /Q "%Temp%\t*.tmp" /Q is Quiet Mode - it deletes without asking if OK when using wildcards. When I do this at Command Prompt: echo %temp% I get this: C:\DOCUME~1\Richard\LOCALS~1\Temp Which is short for: C:\Documents and Settings\Richard\Local Settings\temp HTH. (Hope This Helps. --Richard - - - "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate - - - |
#44
|
|||
|
|||
Creating a .bat file?
Thanks for explaining this, Richard, but I finally lost all patience
with the troublesome app and uninstalled it. Apologies to you, John and everyone else who helped me for wasting your time, although I did learn something about batch files for future reference, so, from my point of view, it wasn`t a wasted exercise. Kate "Richard" wrote in message ... "Kate" wrote in message ... Thank you very much once again, John. Works a treat. Somebody told me that the % sign can be used instead of writing out the whole path, but, as a complete DOS novice, I think I would rather see the full path so that I can easily see if I have made any mistakes. Kate Hi Kate, Yes, the % sign is used in environment variables. You could use something like this in your batch file: del /Q "%UserProfile%\Local Settings\Temp\PTM*.tmp" del /Q "%UserProfile%\Local Settings\Temp\t*.tmp" This works the same on my system: del /Q "%Temp%\PTM*.tmp" del /Q "%Temp%\t*.tmp" /Q is Quiet Mode - it deletes without asking if OK when using wildcards. When I do this at Command Prompt: echo %temp% I get this: C:\DOCUME~1\Richard\LOCALS~1\Temp Which is short for: C:\Documents and Settings\Richard\Local Settings\temp HTH. (Hope This Helps. --Richard - - - "John John - MVP" wrote in message ... Use the RD command. rd /s /q "F:\Documents and Settings\(user)\Cookies\(folder name)" At the Command Prompt do RD /? for information on the switches. John Kate wrote: I`m glad you posted, Bill, because it has given me a chance to ask for more help, please? The same program that I have been grumbling about puts a "Hidden" folder in my Documents and Settings\(user)\Cookies folder. Because I have "Show Hidden Files & Folders" checked, I am able to see it, but cannot delete it using the line del "F:\Documents and Settings\(user)\Cookies\(folder name)" The contents of the folder are deleted, but not the folder. What sort of wording should I use to delete the folder itself and its contents, please? Many thanks Kate - - - |
Thread Tools | |
Display Modes | |
|
|