usera Posted April 24, 2011 Share Posted April 24, 2011 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 Link to comment Share on other sites More sharing options...
jaberwacky Posted April 24, 2011 Share Posted April 24, 2011 Create a d: partition on the c: drive? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
usera Posted April 24, 2011 Author Share Posted April 24, 2011 Create a d: partition on the c: drive?"Create a d: partition on the c: drive?" !!! ??? Link to comment Share on other sites More sharing options...
JoHanatCent Posted April 24, 2011 Share Posted April 24, 2011 "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:\") Link to comment Share on other sites More sharing options...
jchd Posted April 24, 2011 Share Posted April 24, 2011 (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 April 24, 2011 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 hereRegExp tutorial: enough to get startedPCRE 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) Link to comment Share on other sites More sharing options...
saywell Posted April 24, 2011 Share Posted April 24, 2011 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.WilliamPS 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. Link to comment Share on other sites More sharing options...
usera Posted April 24, 2011 Author Share Posted April 24, 2011 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 Link to comment Share on other sites More sharing options...
usera Posted April 24, 2011 Author Share Posted April 24, 2011 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 Link to comment Share on other sites More sharing options...
usera Posted April 24, 2011 Author Share Posted April 24, 2011 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 Link to comment Share on other sites More sharing options...
jchd Posted April 24, 2011 Share Posted April 24, 2011 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 hereRegExp tutorial: enough to get startedPCRE 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) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 24, 2011 Moderators Share Posted April 24, 2011 (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. Edited April 24, 2011 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now