spooky655 Posted August 19, 2008 Share Posted August 19, 2008 (edited) I've tried to automate a few processes such as deleting desktop icons by place .bat files on the cd and running then with the runonce option in the "unattended" section. I see the command prompt come up as it's loading the desktop for the first time, but the .bat files seem to have no affect. I try running them off the cd manually, but they still have no effect. When I copy them to the Desktop though, the work perfectly fine. I'm assuming the problem has to do with permissions and was wondering how to fix this.EDIT: To be more specific, this happened while trying to delete with the "rd" (remove directory) command. Edited August 19, 2008 by spooky655 Link to comment Share on other sites More sharing options...
spooky655 Posted August 19, 2008 Author Share Posted August 19, 2008 I just realized that it may not be the permissions, but could be due to the fact that the Desktop may not exist yet. If this is so, does anyone know how to automate clearing the Desktop icons? Link to comment Share on other sites More sharing options...
spooky655 Posted August 20, 2008 Author Share Posted August 20, 2008 Actually I was wrong... I don't know what's wrong... Here's the .bat file:cd "C:\Documents and Settings\Administrator\Desktop\" && rd /s . /q && cd "C:\Documents and Settings\All Users\Desktop\" && rd /s . /q && cd C:\Windows\system32\ && EmptyRecycleBin.exe /qWhen I run it off the cd, nothing happens. When I copy to a folder (ex. My Documents) it deletes the icons from Administrator/Desktop, but not from All Users/Desktop.The other problem I had was with this .bat file:cd C:\AstonSettings\ && move Aston.7z "C:\Documents and Settings\Administrator\Application Data\Aston\" && cd "C:\Documents and Settings\Administrator\Application Data\Aston\" && 7z x Aston.7z && del Aston.7z && rd /s C:\AstonSettings\ /qWhen I logon for the first time, I find that nothing has happened. When I copy the .bat file to the Desktop and run it, It works fine. Link to comment Share on other sites More sharing options...
TranceEnergy Posted August 20, 2008 Share Posted August 20, 2008 Try with attrib command. To remove -system flag (-s remove / +s activate).I have to do that to get rid off pagefile.sys from system. Link to comment Share on other sites More sharing options...
spooky655 Posted August 20, 2008 Author Share Posted August 20, 2008 (edited) Thanks for replying! But how exactly do I use the command (where in the batch file)? I don't know too much about using the command prompt.btw, I made the same post in another section of the forums because I was sure if this was the right one. Edited August 20, 2008 by spooky655 Link to comment Share on other sites More sharing options...
spooky655 Posted August 20, 2008 Author Share Posted August 20, 2008 Do I use "attrib -s"? Link to comment Share on other sites More sharing options...
spooky655 Posted August 20, 2008 Author Share Posted August 20, 2008 I used "attrib -s" on the directory that I'm trying to delete the files off of, but I still get the same results Link to comment Share on other sites More sharing options...
TranceEnergy Posted August 20, 2008 Share Posted August 20, 2008 I assume the && stands for a continue in the command line? why not separate the commands, it seems awfully long for a single command line.you might need to activate wildcard extension. Im not on my regular computer so cant lookup any specific information atm.Try with separating the different commands and you should be fine. Link to comment Share on other sites More sharing options...
spooky655 Posted August 21, 2008 Author Share Posted August 21, 2008 So I have to make like 20 batch files? Link to comment Share on other sites More sharing options...
spooky655 Posted August 21, 2008 Author Share Posted August 21, 2008 I figured it out! The Problem was the "cd" command. For some reason it didn't work so I just used absolute paths and replaced the "rd" commands with "del". Link to comment Share on other sites More sharing options...
spooky655 Posted August 21, 2008 Author Share Posted August 21, 2008 Incase anyone wanted to see them, here are the batch files:del /s /f /q "C:\Documents and Settings\Administrator\Desktop\*" && del /s /f /q "C:\Documents and Settings\All Users\Desktop\*"move C:\AstonSettings\Aston.7z "C:\Documents and Settings\Administrator\Application Data\Aston\" && 7z x -y -o"C:\Documents and Settings\Administrator\Application Data\Aston\" "C:\Documents and Settings\Administrator\Application Data\Aston\Aston.7z" && del /f /q "C:\Documents and Settings\Administrator\Application Data\Aston\Aston.7z" && rd /s C:\AstonSettings\ /q Link to comment Share on other sites More sharing options...
TranceEnergy Posted August 23, 2008 Share Posted August 23, 2008 You dont need to use the && you can just hit enter in notepad and start on new commandline =) And of course you dont need more batch files.Why are you doing this anyway? To unpack you docs&settings user profile? Lots of stuff in there that cant be reused on reinstalls. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now