Computing.Net > Forums > Programming > saving settings

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

saving settings

Reply to Message Icon

Name: kOBRA
Date: October 14, 2009 at 03:04:19 Pacific
OS: Windows Vista/XP
CPU/Ram: 2GB
Subcategory: Batch
Comment:

hi, i made a batch file which deletes the contents of a predefined folder that i regularly use as temporary folder 4 downloading images from the net. but now i want that batch file to ask me for the folder location(got multiple folders for multiple file types), then save it to a settings file and never ask for the location again since it's already selected and saved 2 the settings file. i'm almost new 2 programming and struck. i've modified my earlier one though...but it's not working. it asks 4 the location, saves the settings but doesn't delete anything. here's my modification....

@echo off

echo "Enter the directory"
set /p dir=

ECHO %dir% > settings.ini
set /p dir= <settings.ini

pause

attrib -r -h -s "%dir%\*" /S /D /L
del "%dir%" /s /q
pause
@end

and the result.....

"Enter the directory"
E:\WF\CMD\O
Press any key to continue . . .
Unable to change attribute - E:\WF\CMD\O \CMD.rar
Unable to change attribute - E:\WF\CMD\O \d.rar
Unable to change attribute - E:\WF\CMD\O \settings (2).dat
Unable to change attribute - E:\WF\CMD\O \settings.dat
Could Not Find E:\WF\CMD\O \*
Press any key to continue . . .

any HELP from anyone PLEASE???



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 14, 2009 at 06:05:00 Pacific
Reply:

[1] I avoid using any internal command or reserved word as a var or directory name. [dir cmd]

[2] ATTRIB may need *.*

[3] This line:

ECHO %dir% > settings.ini

puts a space at the end of your intended path and throws a wrench in the works. Look at your attrib errors.


=====================================
Helping others achieve escape felicity

M2


0

Response Number 2
Name: Razor2.3
Date: October 14, 2009 at 19:30:04 Pacific
Reply:

[2] ATTRIB may need *.*
These days, not so much. (WinXP+, don't know about Win2K)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: saving settings

save settings www.computing.net/answers/programming/save-settings/1982.html

Saving User Information www.computing.net/answers/programming/saving-user-information/2887.html

creare registry with visual basic www.computing.net/answers/programming/creare-registry-with-visual-basic/1249.html