Jump to content

niranjan8shh

Members
  • Posts

    10
  • Joined

  • Last visited

niranjan8shh's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I am not sure what is meant by relative time, but inbuilt macros: "@SEC", "@MIN", "@HOUR", "@MDAY", "@MON", "@YEAR", "@WDAY", "@YDAY", can retrieve time, date etc.regards
  2. You do not need admin rights if you just want to copy files to WINNT folder.If the concerned file is an executive which starts installation of a software package, then launching it with RunAs on W2K/XP is simple enough. In some cases software installation which does only require copying files and writing to HKCU registry keys, does not require admin privileges.
  3. Beware though that xcopy behaves differently in NT4 W2k and XP, in case your script has to work on multiple systems. Of particular significance is /Y which is not understood by NT4, as well as that xcopy on NT4 keeps asking if the file to be copied is a file or a directory if folders do not exist in advance.I found it the hard way. regards niranjan
  4. JdeB, My understanding is that @ERROR is just an internal Au3 Macro for retruncode. A full list of Internal Macros is in the helpfile, and a full test of all of these Macros is done by van_renier availabel at: http://groups.yahoo.com/group/AutoItList/files/AU3/SCRIPTS/ FULL Test of Auto-it Switches and innate variables.zip from Autoit3 help file Macros ====== Read only variables with special values. Similar to the AutoIt v2 "A_DAY" type variables. e.g. @MyDocuments, @StartupCommon Full list: "error", "SEC", "MIN", "HOUR", "MDAY", "MON", "YEAR", "WDAY", "YDAY", "ProgramFilesDir", "CommonFilesDir", "MyDocumentsDir", "AppDataCommonDir", "DesktopCommonDir", "DocumentsCommonDir", "FavoritesCommonDir", "ProgramsCommonDir", "StartMenuCommonDir", "StartupCommonDir", "AppDataDir", "DesktopDir", "FavoritesDir", "ProgramsDir", "StartMenuDir", "StartupDir", "Computername", "WindowsDir", "SystemDir", "SW_HIDE", "SW_MINIMIZE", "SW_MAXIMIZE", "SW_RESTORE", "SW_SHOW", "ScriptFullPath", "ScriptName", "ScriptDir", "WorkingDir", "OSType", "OSVersion", "OSBuild", "OSServicePack", "AutoItVersion", "IPAddress1", "IPAddress2", "IPAddress3", "IPAddress4", "CR", "LF", "CRLF", "DesktopWidth", "DesktopHeight" ======
  5. Thanks JdeB. I am a newbie, aand code you have suggested is of course more neat. Re errorcode: I would like to hear from the gurus in this forum , but it looks like a bug. In addidion is also the issue of getting no syntax error when I tried If FileExists("$mozkonf\mozilla.bmp") Then and Larry corrected it to If FileExists($mozkonf & "\mozilla.bmp") Then and it started to work, which BTW seems to be the case in your line too $rc = FileCopy("$mozkonf\mozilla.bmp", "C:\TEMP\TEST\mozilla.bmp") regards, niranjan.
  6. Hi again, I tested the code without $ but still incorrect filecopy success report:--- start code --- If FileExists("E:\AUTOIT\SOURCE\mozilla.bmp") MsgBox(0, "Existence", "file exists") Else MsgBox(0, "Existence", "file does not exist") EndIf FileCopy ("E:\AUTOIT\SOURCE\mozilla.bmp", "E:\AUTOIT\DEST\mozilla.bmp" ,1) If @ERROR == 0 Then MsgBox(0, "Copied - Yes", "Filecopy command returned 0=Success !") Else MsgBox(0, "Copied - No", "Filecopy command returned 1=Fail !") EndIf Exit --- end code --- If file really exists at source dir, it does report existence and does get copied and get reported as success. BUT If file does not exist at source, it gets corrrectly reported by FileExists command as not existing, AND it gets reported by FileCpy command as "Filecopy command returned 0=Success !" Perhaps FileCopy command reports errors differently. niranjan
  7. Thanks Larry, that did the trick on FileCopy as well.However I wonder why did it keep telling "File Copied" and did not complain of any syntax errors. regards niranjan
  8. Hi, I am puzzled by the follwoing: ------ start code ----- $mozkonf = "I:\netconf\mozilla" If FileExists("$mozkonf\mozilla.bmp") Then MsgBox(0, "Existence - Yes", "File exists") Else MsgBox(0, "Existence - NO", "File not found") EndIf FileCopy("$mozkonf\mozilla.bmp", "C:\TEMP\TEST\mozilla.bmp") If @ERROR == 0 Then MsgBox(0, "Copied - Yes", "File copied") Else MsgBox(0, "Copied - No", "File not copied") EndIf Exit ------ end code ----- First I am getting "File not found" and then "File copied" message. My first questions is: How can FileCopy succeed if FileExists failed to find the file? (I am sure that the path is correct, and the file exists, and I have all the necessary access.) Second, the file doesn't get copied, but the errorlevel after FileCopy command is 0. Which would mean the command completed successfully. The behaviour doesn't change even if I replace the network path with local exact path. The OSes on which this is tested is XP Pro and W2K. Anyt help and hints are appreciated. regards niranjan
×
×
  • Create New...