本帖最后由 kingshui 于 2013-3-12 10:39 编辑
回复 4# Batcher
非常感谢,不过prefs.js是多行内容- # Mozilla User Preferences
-
- /* Do not edit this file.
- *
- * If you make changes to this file while the application is running,
- * the changes will be overwritten when the application exits.
- *
- * To make a manual change to preferences, you can visit the URL about:config
- */
-
- user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1363012569);
- user_pref("app.update.lastUpdateTime.background-update-timer", 1363042459);
- user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 1363012689);
- user_pref("app.update.lastUpdateTime.browser-cleanup-thumbnails", 1363046299);
- user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1363035379);
- user_pref("browser.cache.disk.capacity", 358400);
- user_pref("browser.cache.disk.smart_size.first_run", false);
- user_pref("browser.cache.disk.smart_size.use_old_max", false);
- user_pref("browser.cache.disk.smart_size_cached_value", 358400);
- user_pref("browser.download.dir", "X:\\PortableAPPC\\MyFirefox\\Downloads");
- user_pref("browser.download.folderList", 2);
- user_pref("browser.download.panel.firstSessionCompleted", true);
- user_pref("browser.download.panel.shown", true);
- user_pref("browser.migration.version", 9);
- user_pref("browser.newtabpage.enabled", false);
- user_pref("browser.newtabpage.storageVersion", 1);
- user_pref("browser.pagethumbnails.storage_version", 3);
- user_pref("browser.panorama.experienced_first_run", true);
- user_pref("browser.panorama.session_restore_enabled_once", true);
- user_pref("browser.places.smartBookmarksVersion", 4);
- user_pref("browser.preferences.advanced.selectedTabIndex", 4);
- user_pref("browser.rights.3.shown", true);
- user_pref("browser.safebrowsing.enabled", false);
- user_pref("browser.safebrowsing.malware.enabled", false);
- user_pref("browser.search.selectedEngine", "Google AS - 中文网页");
- user_pref("browser.sessionstore.restore_on_demand", false);
- user_pref("browser.shell.checkDefaultBrowser", false);
- user_pref("browser.startup.homepage", "chrome://ubufox/locale/ubufox.properties");
- user_pref("browser.startup.homepage_override.buildID", "20130310030906");
- user_pref("browser.startup.homepage_override.mstone", "22.0a1");
- user_pref("browser.startup.page", 3);
- user_pref("browser.syncPromoViewsLeftMap", "{\"passwords\":0}");
- user_pref("browser.tabs.warnOnClose", false);
- user_pref("capability.policy.maonoscript.javascript.enabled", "allAccess");
复制代码 是不是用以下这段会比较好点?- setlocal enabledelayedexpansion
- if not exist %DownDir% md %DownDir%
- set prefs=%~dp0%PFDir%\prefs.js
- set downdir=%~dp0%DownDir%
- set dirname=%downdir:\=\\%
- set ddir=user_pref("browser.download.folderList", 2);
- set downdir=user_pref("browser.download.dir","%dirname%");
- set count=0
- for /f "skip=2" delims=[] tokens=1" %%i in ('find /n "browser.download.dir" %prefs%) do (
- set /a row=%%i-2
- for /f "delims=" %%j in (%prefs%) do (
- set /a count=!count!+1
- if !count! equ !row! (echo !downdir!>>str) else (echo %%j>>str)
- )
- )
复制代码 要认真学习了。楼上的批完全理解了之后应该会明白很多,谢谢,非常感谢 |