Sign in to follow this  
Followers 0
usera

Redirect

11 posts in this topic

Greeting,

Had a program always export the report to D:\temp\report.log.

Now do not have Drive D: any more. so the program do not working well any more.

Is any way to make a script that stay in memory. when the report try to create the report to d:\temp\report.log then redirect to c:\temp\report.log?

Thanks

usera

Share this post


Link to post
Share on other sites



Create a d: partition on the c: drive?

"Create a d: partition on the c: drive?" !!! ???

Share this post


Link to post
Share on other sites

"Create a d: partition on the c: drive?" !!! ???

Could work BUT be careful not to loose data.

Alternarively run this once when you boot the PC or just before you run your program:

#include <Process.au3>
_RunDOS("subst d: c:\")

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Make the target directory shareable (say C:\MyLogDir) and connect D: as a local "remote drive" using explorer to \\Your_PC_Name\MyLogDir. Create subdir(s) in D: as required (temp, ...)

Check "Reconnect at Windows startup". Edit access rights to accounts that need it if any sensible data.

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

I would second the suggestion to use the DOS Subst function, but suggest pointing it at a folder on the c: drive [C:\d ?] rather than the root of C:.

"Subst D: C:\d"

When you've finished, use Subst D: /D to undo the substitution.

William

PS I tried the network mapping function DriveMapAdd to replace the DOS command, but it didn't work. Is thera any way to use this command on a local folder?

W.

Share this post


Link to post
Share on other sites

Could work BUT be careful not to loose data.

Alternarively run this once when you boot the PC or just before you run your program:

#include <Process.au3>
_RunDOS("subst d: c:\")

Thanks for the idea, but it will impact another applications

Share this post


Link to post
Share on other sites

Make the target directory shareable (say C:\MyLogDir) and connect D: as a local "remote drive" using explorer to \\Your_PC_Name\MyLogDir. Create subdir(s) in D: as required (temp, ...)

Check "Reconnect at Windows startup". Edit access rights to accounts that need it if any sensible data.

Thanks for the idea, but it will impact another applications

Share this post


Link to post
Share on other sites

Thanks for all the offers so far.

I do believe what I am looking for is kind of script to running in the Memory, and in real time check if the file access is "d:\temp\report.log" then redirect to "c:\temp\report.log", if it is not "d:\temp\report.log", then just like nothing happened.

Thanks

usera

Share this post


Link to post
Share on other sites

I don't get it. You say you don't have a D: drive anymore. Then how can linking D:\temp to another path affect other applications as well?

Other possibility: patch the offending program into using W:\temp instea of D:\temp and assign W: to whatever existing local or remote path of your choice.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I'm not sure I get it either.

1. Go to C:\ Drive Root

2. Create a folder "D$"

3. Go to Tools -> Map Network Drive

4. Map \\[Computer]\D$ to D: drive.

5. Start on Startup

Now you have a "D:" drive without partitioning, without redirecting C:\ traffic to a D:\ folder, so now anything that would write to "D:" drive, will now write to D$ folder.

Then you can do what you want from the outside ( eg. Write something that checks that folder for new files, then move them where ever you want ).

See attached ( note, I changed the folder icons to look like drives for J$ and K$ myself ).

Edit:

I'll also say this, if there's only 1 app you're concerned with, you could check the registry for either that app or that file location it writes to.

More than likely it writes its final destination file there... if it does, than just change it to where you want it to go.

If that doesn't work, try re-installing the app.

post-4813-0-84370900-1303682492_thumb.pn

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  
Followers 0