Jump to content
Sign in to follow this  
MrSheen

Redirecting appdata

Recommended Posts

MrSheen

Redirecting appdata,

I dont know if redirecting is the right word to use, however a few games and programs stick a folder with a single file into appdata. Which I was wondering can you actually run say WinRar, Lemmings etc and have it redirect what the program is sending to appdata into the current folder?

I know you can use DirMove and DirRemove to copy them back and fourth but would like to know if there is a way to have windows believe the current folder is actually the appdata folder while running the game/program.

Share this post


Link to post
Share on other sites
JScript

Try this example:

Local $sMyCurrentFolder = ; Type the folder you want.
Local $sGameFullPath = ; Type the 'full path' of game/program you want

; Redirecting appdata...
EnvSet("APPDATA", $sMyCurrentFolder); Thanks to ProgAndy...
EnvUpdate() ; Refreshes the OS environment.

; load your game/program
RunWait($sGameFullPath)
This solves?

EnvSet("APPDATA", $sMyCurrentFolder); Thanks to ProgAndy...

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites
MrSheen

Thank you for your help.

Nope it does not work, tried it on a five games and two program and still ends up saving in to the appdata folder.

Share this post


Link to post
Share on other sites
ProgAndy

Just try this:

Local $sMyCurrentFolder = "D:\TEMP"; Type the folder you want.
Local $sGameFullPath = "cmd /k echo APPDATA = %APPDATA%"; Type the 'full path' of game/program you want

; Redirecting appdata... only for this script and its child processes
EnvSet("APPDATA", $sMyCurrentFolder)
EnvUpdate() ; Refreshes the OS environment.

; load your game/program as a child
Run($sGameFullPath)
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
MrSheen

Tried the second one and it still uses the system appdata folder, tried a simple batch with "Set APPDATA = F:\storage" and that also never redirected anything.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×