orbs Posted May 8, 2014 Share Posted May 8, 2014 (edited) DOS remembers the working directory for each drive separately. how do i use AutoIt functions to make use of that feature? for example: #include <File.au3> #include <Array.au3> FileChangeDir('C:\TEMP') ; the next command lists the contents of C:\TEMP as expected RunWait(@ComSpec&' /k dir c: /b') ; the next command lists the contents of C:\ (root), even without the backslash, ; so it's not quite like the help file states: "...Similar to using Dir with the /B Switch" $a=_FileListToArray('C:') _ArrayDisplay($a) EDIT: but this works as expected: FileCopy('C:*','E:\TEMP\',8) but if i do this FileChangeDir('D:') FileCopy('C:*','E:\TEMP\',8) then FileCopy() relates to C: root again, even without the backslash. and it keeps it at root. however with the batch equivalent: cd c:temp dir c: /b cd d: dir c: /b ...the final command still relates to c:temp Edited May 8, 2014 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
JohnOne Posted May 8, 2014 Share Posted May 8, 2014 working directories have always confused me, first I thought there was one and it was system wide, then someone mentioned they can be per process, now this. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
orbs Posted May 8, 2014 Author Share Posted May 8, 2014 per-process makes sense, as all environment elements can be set differently for every process. - you can set the same environment variable %MYVAR% to some value for one process, and another value for another process; actually the system will hold two environment variables named %MYVAR%, segregated, one for each process. - you can "inherit" the environment of a calling process to the called process, but that would be replicating the environment, so if the called process changes something in the environment, the calling process won't see it. but anyway, per-drive working directory is something i'd like the AutoIt experts to elaborate on, because DOS supports it, so no reason AutoIt wouldn't... but how? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff 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