Блог → Программирование

Подменяем папки пользователя в Windows

Удивительно, но немногие знают, что стандартные переменные среды в «винде» можно переопределить для отдельной программы. Сделать это можно, например, вот таким файлом:

@echo off && %~d0 && cd %~dp0

rem Имя *.exe файла программы
set app=chrome.exe

rem Папка с профилем
set folder=profile

md "%folder%\AppData\Local\Temp"
md "%folder%\AppData\Roaming"
set ALLUSERSPROFILE=%~dp0%folder%
set APPDATA=%~dp0%folder%\AppData\Roaming
set HOMEDRIVE=%~d0
set HOMEPATH=%~p0%folder%
set LOCALAPPDATA=%~dp0%folder%\AppData\Local
set TEMP=%~dp0%folder%\AppData\Local\Temp
set TMP=%~dp0%folder%\AppData\Local\Temp
set USERNAME=%folder%
set USERPROFILE=%~dp0%folder%

start %app%

Здесь у нас переопределяются пути пользователя. Вместо chrome.exe подставляем название своей программы, вместо profile пишем название папки, в которую будут сохранятся данные пользователя, сохраняем с расширением cmd или bat, кладём к программе и запускаем.

Зачем это можно использовать:

12 февраля 2013 14:44 

Комментарии


Алексей
Алексей — 9 лет назад
Добрый день!
Какое-то время пользовался подобным батником для запуска двух версий программы Google Диск. Но с очередным обновлением Windows 10 вторая версия программы перестала запускаться. В диспетчере задач появляются дополнительные процессы, но тут же пропадают.
Подскажите, пожалуйста, как можно возобновить работу нескольких версий программы Google Диск одновременно в одной сессии Windows.
Спасибо!

DuMOHsmol
DuMOHsmol — 9 лет назад anothersite.ru
Привет. Сейчас проверил свой батник со свежим Google Drive — две копии запускаются. Проверял на Windows 10 с последними обновлениями.

https://w4i9o.Mssg.me/
https://w4i9o.Mssg.me/ — 3 недели назад
I really like what yyou guys are up too. This sort of clever work and exposure!
Keep up the terrific works guys I've added you guys
to blogroll. https://w4i9o.Mssg.me/

https://Caramellaapp.com/milanmu1/bMm9pGRz8/successful-goalkeepers
https://Caramellaapp.com/milanmu1/bMm9pGRz8/successful-goalkeepers — 3 недели назад
Hi, always i used to check webpage posts here in the early hours in thhe break of day, because i enjoy
to gain knowledge of more and more. https://Caramellaapp.com/milan...ful-goalkeepers

https://Qjobsbd.com/employer/tonebet-casino
https://Qjobsbd.com/employer/tonebet-casino — 3 недели назад
Very nice post. I just stumbled upon your weblog and
wished to say that I have truly enjoyed surfing around your blog posts.
In any case I'll be subscribing to yur feed and I hope you
write again very soon! https://Qjobsbd.com/employer/tonebet-casino

https://Onlinemarketings2025.Wordpress.com/
https://Onlinemarketings2025.Wordpress.com/ — 2 недели назад
Pretty nice post. I just stumbled upon your weblog and wished to say that I have truly enjoyed browsing your
bog posts. After all I'll bee subscribing tto ykur rss feed and I hope you write
again very soon! https://Onlinemarketings2025.Wordpress.com/

https://G5Coj.Mssg.me/
https://G5Coj.Mssg.me/ — 2 недели назад
Very great post. I simply stumbled upon your weblog and wished to say that I have truly
enjoyed surfing around your blog posts. In any case I'll be subscribing on your rss feed and I'm oping you write
once more very soon! https://G5Coj.Mssg.me/

https://zenwriting.net/fou9plvhra
https://zenwriting.net/fou9plvhra — 1 неделю назад
Hi there! I could have sworn I've visiteed this web site
before but after loooking at many of the possts I reaqlized it's new to
me. Anyhow, I'm definitely delighted I came across it and I'll bee bookmarking it and checking back often! https://zenwriting.net/fou9plvhra

https://sites.google.com/view/top-ratedonlineslots/top-rated-online-slots
https://sites.google.com/view/top-ratedonlineslots/top-rated-online-slots — 1 неделю назад
Good day very nice website!! Maan .. Excellent ..
Superb .. I will bookmark your site and take the feeds additionally?
Iamm happy to search out a lot of helpful information here within the submit, we'd like work oout
extra techniques in this regard, thanks for sharing. . . .

. . https://sites.google.com/view/...ed-online-slots

https://Writeablog.net/sp344ovahs
https://Writeablog.net/sp344ovahs — 1 неделю назад
This paragraph is really a nice one it helps neww web people, whoo are wishing for blogging. https://Writeablog.net/sp344ovahs

https://penzu.com/public/9461c2a5851a828c
https://penzu.com/public/9461c2a5851a828c — 1 неделю назад
I have been browsing on-line more than 3 hours
nowadays, yet I by no meanbs discovered any attention-grabbing article like yours.
It iis pretty value sufficient for me. In my opinion, if all web
owners and bloggers made good content material ass you did, the internet shall be a lot more helpful than ever before. https://penzu.com/public/9461c2a5851a828c

https://justpaste.it/azurslot1
https://justpaste.it/azurslot1 — 1 неделю назад
Unquestionably believe that which you stated. Your
favorite reason seemed to be on the web the easiest thing to bbe aware of.
I say to you, I definitely get irked while people think about worries that they just do not know about.
You managed to hit the nail upon the toop and defined out the wholpe thing without haaving side efffect
, people can take a signal. Wiill likely be back to gget more.

Thanks https://justpaste.it/azurslot1

https://anotepad.com/note/read/3naad9pp
https://anotepad.com/note/read/3naad9pp — 1 неделю назад
I'm really loving the theme/design of your blog. Do you ever runn into any web browser compatibility issues?
A number of my blog readers ave complained about my website not working corectly in Explorewr but looks great in Firefox.
Do you have any advice to help fix this issue? https://anotepad.com/note/read/3naad9pp

https://Zenwriting.net/zwsjn1f96j
https://Zenwriting.net/zwsjn1f96j — 1 неделю назад
Can you tell us more about this? I'd love to find out some additional information. https://Zenwriting.net/zwsjn1f96j

https://Telegra.ph/Online-Gambling-Experience-09-02
https://Telegra.ph/Online-Gambling-Experience-09-02 — 1 неделю назад
This post is priceless. How can I find out more? https://Telegra.ph/Online-Gamb...xperience-09-02

https://therealestatepk.com/author/blondellmci10/
https://therealestatepk.com/author/blondellmci10/ — 1 неделю назад
Helpful information. Fortunate me I found your site by accident, and I am stunned
why this accident did not came about earlier! I bookmarked it. https://therealestatepk.com/au.../blondellmci10/

https://Www.finestresidences.com/author/albadexter402/
https://Www.finestresidences.com/author/albadexter402/ — 1 неделю назад
Hello! I just wanted to ask if you ever have any issues with hackers?
My last blog (wordpress) wass hacked and I ended up losing many months of hard work due to no bacdk up.
Do yoou have any solutions tto protect against hackers? https://Www.finestresidences.c.../albadexter402/

https://Terrasolutionsrealty.com/author/darinenyeart41/
https://Terrasolutionsrealty.com/author/darinenyeart41/ — 1 день назад
This excellent website definitely has all of the information I
needed about this subject and didn't know who to ask. https://Terrasolutionsrealty.c...darinenyeart41/

https://careers.cblsolutions.com/employer/escort-girl/
https://careers.cblsolutions.com/employer/escort-girl/ — 1 день назад
Hi there, its good paragraph concerning media print, we all be familiar with media
is a wonderful source of data. https://careers.cblsolutions.c...er/escort-girl/

https://rogeriomirandaimoveis.com.br/agent/donnymcgruder/
https://rogeriomirandaimoveis.com.br/agent/donnymcgruder/ — 1 день назад
Why visitors still use to read news papers when in this technological globe all
is available on web? https://rogeriomirandaimoveis..../donnymcgruder/

https://teachanycountry.com/employer/euro-girls-escort/
https://teachanycountry.com/employer/euro-girls-escort/ — 1 день назад
Awesome post. https://teachanycountry.com/em...o-girls-escort/

https://Realtyonegroupsurf.com/author/cathywilkinson/
https://Realtyonegroupsurf.com/author/cathywilkinson/ — 1 день назад
Great delivery. Outstanding arguments. Keep up the amazing work. https://Realtyonegroupsurf.com...cathywilkinson/

https://kingsland.pk/author/kuikam26872666/
https://kingsland.pk/author/kuikam26872666/ — 1 день назад
Today, while I was at work, my cousin stole my apple ipad and tested to see if it can survive a
25 foot drop, just so she can be a youtube sensation. My
iPad is now destroyed and she has 83 views. I know this is completely off topic but I
had to share it with someone! https://kingsland.pk/author/kuikam26872666/

Ваше имя Сайт или блог (опционально) Аватар (опционально, e-mail для Gravatar или ссылка на картинку с ipic.su) Текст комментария

Справка по написанию комментария

  • Для вставки аватара зарегиструйтесь на сервисе Gravatar и укажите ваш e-mail. Вы также можете загрузить аватар на http://ipic.su и скопировать текст с поля «прямая ссылка». Другие сервисы или хостинги изображений не поддерживаются. Большие изображения будут уменьшены автоматически. Пример:

    http://ipic.su/img/img7/fs/user4.1358962896.png
  • Имя, адрес и аватар сохраняются, второй раз вводить не придётся
  • Кликните на аватар, чтобы вставить имя пользователя
  • Слово обрамлённое «звёздочками» становится *жирным*
  • Адрес ссылки автоматически становится ссылкой — http://anothersite.ru
  • Ссылки на текст с http://pastebin.com автоматически разворачиваются в тексте комментария
  • Цитату следует начинать со знака «больше»:
    > пример многострочной
    > цитаты