t0ddie Posted November 25, 2005 Share Posted November 25, 2005 i have a file in temp dir FileInstall("help.txt",@tempDir & "\help.txt",1) i want to view it but i know this wont work. Run("Notepad.exe", "", @SW_MAXIMIZE) and i know you cant run a .txt file so i need a refresher.. how to open this file for the user? Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Danny35d Posted November 25, 2005 Share Posted November 25, 2005 Did you try this?Run("Notepad.exe " & @TempDir & "\help.txt", "", @SW_MAXIMIZE) AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
LxP Posted November 25, 2005 Share Posted November 25, 2005 It's probably wise to surround the file in double quotes in case the temporary path contains spaces: Run('Notepad.exe "' & @TempDir & '\help.txt"', '', @SW_MAXIMIZE) Link to comment Share on other sites More sharing options...
MHz Posted November 25, 2005 Share Posted November 25, 2005 It's probably wise to surround the file in double quotes in case the temporary path contains spaces: Run('Notepad.exe "' & @TempDir & '\help.txt"', '', @SW_MAXIMIZE)@Tempdir and %temp% always use 8.3 filenames for the path. Link to comment Share on other sites More sharing options...
LxP Posted November 25, 2005 Share Posted November 25, 2005 Only if %Temp% is defined as an 8.3 path in the first place though, which should not be relied upon: EnvSet('Temp', 'C:\Program Files\Microsoft Temp') MsgBox(0x40, 'Debug', EnvGet('Temp')) This is just an example to show that there's no automatic conversion -- it's completely possible that a user may modify their %Temp% setting through a conventional means such as the appropriate dialogue under XP or perhaps AUTOEXEC.BAT under '98. Link to comment Share on other sites More sharing options...
MHz Posted November 25, 2005 Share Posted November 25, 2005 Only if %Temp% is defined as an 8.3 path in the first place though, which should not be relied upon: EnvSet('Temp', 'C:\Program Files\Microsoft Temp') MsgBox(0x40, 'Debug', EnvGet('Temp')) This is just an example to show that there's no automatic conversion -- it's completely possible that a user may modify their %Temp% setting through a conventional means such as the appropriate dialogue under XP or perhaps AUTOEXEC.BAT under '98.Well, I can't say much for EnvSet() as it does not physically change the %temp% environmental variable and why someone would not use default?! But if you do check in your registy in XP, then you may see spaces in your temp variable but when you use the variable, it is 8.3 filename format. I do not currently have a 9x to test on, so cannot state otherwise there. You have mentioned a possible enough doubts to include quotes but if people choose the system defaults then they should be ok without, but there are those who like changing things just cause they can and just like it that way. Link to comment Share on other sites More sharing options...
LxP Posted November 25, 2005 Share Posted November 25, 2005 I can't argue that it's a very remote possibility but it's there nonetheless. One believable example I can foresee is if a user has an additional hard drive and wants to use that (perhaps their system drive is full or slow). They may generally store data on there so they may want a very clear name such as 'D:\Temporary Files'. The fact that Windows allows for this is the problem here (I guess) but I just thought that I should mention it all for fear that such a case will arise. Like typical error checking most of the time it won't be necessary but it's nice to be running a script that can handle abnormal circumstances. Link to comment Share on other sites More sharing options...
Gene Posted November 25, 2005 Share Posted November 25, 2005 (edited) I can't argue that it's a very remote possibility but it's there nonetheless. One believable example I can foresee is if a user has an additional hard drive and wants to use that (perhaps their system drive is full or slow). They may generally store data on there so they may want a very clear name such as 'D:\Temporary Files'.The fact that Windows allows for this is the problem here (I guess) but I just thought that I should mention it all for fear that such a case will arise. Like typical error checking most of the time it won't be necessary but it's nice to be running a script that can handle abnormal circumstances.I for one have the OS on a small (5Gb) drive, consequently my TEMP folder is on another much larger drive and partition as "SysTemp". The same larger drive also has a "Prog" folder which has all the Program Files the installers gave me an option to put other than C:. Neither one of these has spaces, but they could have had. I try to keep an uptodate Ghost of C: and the larger drive is backed up to another machine, so that when either drive fails I will not be seriously inconvenienced.Edit: Hopefully I will not be seriously inconvenienced. Edited November 25, 2005 by Gene [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... 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