Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-29-2006, 08:58 AM   #1 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default autoexe (batch)

if you created a file that wrote a line into the autoexe file would it run that line every time windows starts eg

RMDIR %userprofile%/somefolder

also how would you go about writing this

where is my dos-wizard
Yek is offline  
Old 12-30-2006, 02:47 PM   #2 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

If you want this to run every time you start the computer, create the following batch file and put it in the c:\documents and settings\all users\start menu\programs\startup

Code:
@echo off
rmdir /q /s %userprofile%\folder

__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 12-31-2006, 12:10 PM   #3 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default

how can i get a batch file to create a file in that though as it needs to be downloaded off the net
Yek is offline  
Old 12-31-2006, 09:32 PM   #4 (permalink)
 
Newb Techie

Join Date: Dec 2006

Posts: 21

Stormdev

Default

Although it has been a while since I have worked with batch files the following should suffice for your needs.

Create a new batchfile named makeit.bat (or whatever you want it called for distro via the web).

Insert the following code into the batch file:

Code:
@echo off
echo @echo off > %systemdrive%\cleanit.bat
echo rmdir /q /s %userprofile%\nameoffoldertodelete >> %systemdrive%\cleanit.bat

move %systemdrive%\cleanit.bat "%systemdrive%\documents and settings\all users\start menu\programs\startup"

echo Batchfile Created... Type exit and hit enter...
Don't forget to change the name of the nameoffoldertodelete line above to whatever it is your out to remove.

Hope this helped.
Stormdev is offline  
Old 01-01-2007, 09:36 AM   #5 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default

can you run me over on what this does??
line by line??
Yek is offline  
Old 01-01-2007, 09:37 AM   #6 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default

Sorry im a web designer not a programmer (thanks)
Yek is offline  
Old 01-01-2007, 10:01 AM   #7 (permalink)
 
Newb Techie

Join Date: Dec 2006

Posts: 21

Stormdev

Default

Quote:
Originally posted by Stormdev

Code:
@echo off
echo @echo off > %systemdrive%\cleanit.bat
echo rmdir /q /s %userprofile%\nameoffoldertodelete >> %systemdrive%\cleanit.bat

move %systemdrive%\cleanit.bat "%systemdrive%\documents and settings\all users\start menu\programs\startup"

echo Batchfile Created... Type exit and hit enter...
When makeit.bat is run by a user it does the following:
Line 1: Turns Output Echoing Off (@echo off) so the commands are not spit out to the screen.
Line 2: Creates a new batch file named cleanit.bat with one line of text (@echo off) on the users windows install root (usually C:\) - %systemdrive%\cleanit.bat
Line 3: Appends the command you needed to delete a folder in the specified location to the cleanit.bat file.
Line 4: Moves the newly created cleanit.bat file to the all users startup folder so it runs on startup.
Line 5: Outputs a message that the batchfile was created...


Does this help clarify things a bit?
Stormdev is offline  
Old 01-01-2007, 10:10 AM   #8 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default

Yes thanks , i do understand batch a little , however it was puzzling me with the >> as i have never seen them before used in batch , how would i do 2 or more lines of text?
Yek is offline  
Old 01-01-2007, 10:17 AM   #9 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default

Also i see that the file is created on the systemdrive first , can you create it in the /start menu/... directory first rather than moving it?? (why you want to do this i wouldnt know but just for future refrence )
Yek is offline  
Old 01-01-2007, 10:19 AM   #10 (permalink)
 
Newb Techie

Join Date: Dec 2006

Posts: 21

Stormdev

Default

The greater than operator > overwrites all (like new). The double greater than >> appends or adds another line, so if you needed to add more lines then you would simply use another echo command with the >> append specifier to the same filename.

Basically you create a file line by line. Make sense?
Stormdev is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On