Jump to content

jswilcox1980

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jswilcox1980's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. This could be a formatting issue that i am missing. #include <MsgBoxConstants.au3> #include <file.au3> #include <Array.au3> FileVersions() Func FileVersions() ; Retrieve the file versions of specified 3shape application files Local $DSver = FileGetVersion("C:\Program Files\3Shape\DentalManager\Dentalmanager.exe") Local $DSSver = FileGetVersion("C:\Program Files (x86)\3Shape\Dongle Server Service\DongleServer.exe") Local $ScnSvr = FileGetVersion("C:\Program Files\3Shape\Scansuite\Scanserver.exe") Local $SID = FileGetVersion("C:\Program Files\3Shape\ScanitDental\DentalDesktop.exe") Local $AppDsgnr = FileGetVersion("C:\Program Files\3Shape\ApplianceDesigner\ApplianceDesigner.exe") Local $Splintdsgnr = FileGetVersion("C:\Program Files\3Shape\SplintDesigner Splint\ApplianceDesigner.exe") Local $Versiontextfile = (@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt') ;Clears file from previous contents $hFile = FileOpen($Versiontextfile, 2) FileClose($hFile) Opt ("MustDeclareVars", 1) Local $aNumber = StringRegExp (FileRead ("C:\Program Files (x86)\3Shape\Dongle Server Service\DongleServerConfig.xml"),'Dongle Order="\d+" Number="(\d+)',$STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay ($aNumber) ; Display the file versions ;MsgBox (0,"test",$aNumber[0] & "/" & $aNumber[1]) MsgBox($MB_SYSTEMMODAL,'3Shape Software Versions','Dental System: ' & $DSver &@CRLF _ & 'Dongle Server Service: '& $DSSver & @CRLF _ & 'ScanSuite: '& $ScnSvr & @CRLF _ & 'ScanitDental: '& $SID & @CRLF _ & 'Appliance Designer: '& $AppDsgnr& @CRLF _ & 'Splint Designer: '& $SplintDsgnr &@CRLF _ & 'Dongle Number: '& $aNumber[0] & "/" & $aNumber[1] ) MsgBox($MB_SYSTEMMODAL,'3Shape Software Versions', ' A summary has been saved on the desktop: ' & @CRLF & @CRLF& '" ' & @computername & ' 3shape Dental System File Versions.txt "') ;Below writes all data to text file on desktop FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','***** 3SHAPE DENTAL SYSTEM FILE VERSIONS *****') FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Dental System - '& $DSver) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Dongle Server Service - '& $DSSver) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','ScanSuite - '& $ScnSvr) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Scanit Dental - '& $SID) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Appliance Designer - '& $AppDsgnr) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Splint Designer - '& $SplintDsgnr) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Dongle Number - ') Run("notepad.exe " & $Versiontextfile, @WindowsDir, @SW_MAXIMIZE) EndFunc when i try to run it i get this: "C:\Users\Jeremy Wilcox\Desktop\Test Scripts\Get 3shape File Versions.au3" (29) : ==> Subscript used on non-accessible variable.: MsgBox($MB_SYSTEMMODAL,'3Shape Software Versions','Dental System: ' & $DSver &@CRLF & 'Dongle Server Service: '& $DSSver & @CRLF & 'ScanSuite: '& $ScnSvr & @CRLF & 'ScanitDental: '& $SID & @CRLF & 'Appliance Designer: '& $AppDsgnr& @CRLF & 'Splint Designer: '& $SplintDsgnr &@CRLF & 'Dongle Number: '& $aNumber[0] & "/" & $aNumber[1] ) MsgBox($MB_SYSTEMMODAL,'3Shape Software Versions','Dental System: ' & $DSver &@CRLF & 'Dongle Server Service: '& $DSSver & @CRLF & 'ScanSuite: '& $ScnSvr & @CRLF & 'ScanitDental: '& $SID & @CRLF & 'Appliance Designer: '& $AppDsgnr& @CRLF & 'Splint Designer: '& $SplintDsgnr &@CRLF & 'Dongle Number: '& $aNumber^ ERROR
  2. certainly not looking for anyone to code this for me but i just dont get it. obviously i am trying to do something beyond my knowledge level. I am a visual learner so if i can see a working example i can understand what its doing and why. I have tried adding your code and sort of understand what your saying but i dont know how to "provide the index" of the variable. I Appreciate all of the help you both have given thus far.
  3. Nine, I like this approach but i am unable to get to display the dongle number listed when i place the $anumber variable into my msgbox display code it returns a "1" only? How do i get it to display the 10 digit dongle number? TheXman, I am not sure about the XML portion of this code above, is this specified for structure only or as the source of the code to work? I was unclear what i state on the original post. The dongle numbers will be different on each PC this script will be ran on.
  4. OK I have created a small utility that will display the file versions of the software my customers are using. This information is displayed in a MSGBOX and saved into a Text file on the desktop. I would like to capture the Dongle Number From the XML document, display it in my MSGBOX and save it to the text file also. I have looked at about every xml read post there is and i am seriously missing something. <?xml version="1.0" encoding="UTF-8"?> -<TServerConfig version="1"> -<Object type="TServerConfig" name="MainObject"> <!-- URL of remote web service. Leave undefined for production deployment --> <!-- Port that the server listnes on --> <Property name="ServerPort" value="27027"/> <!-- Server IP, leave empty for autodetect --> <Property name="ServerIP" value=""/> <!-- Write more events to the log file --> <Property name="ExtendedLogging" value="False"/> </Object> -<Dongles> <Dongle Order="0" Number="0123456789"/> <Dongle Order="1" Number="1122334455"/> </Dongles> </TServerConfig> This is my code for the small utility that works , i would like to build in the Dongle numbers that could be extracted from the XML. #include <MsgBoxConstants.au3> #include<file.au3> FileVersions() Func FileVersions() ; Retrieve the file versions of specified 3shape application files $DSver = FileGetVersion("C:\Program Files\3Shape\DentalManager\Dentalmanager.exe") $DSSver = FileGetVersion("C:\Program Files (x86)\3Shape\Dongle Server Service\DongleServer.exe") $ScnSvr = FileGetVersion("C:\Program Files\3Shape\Scansuite\Scanserver.exe") $SID = FileGetVersion("C:\Program Files\3Shape\ScanitDental\DentalDesktop.exe") $AppDsgnr = FileGetVersion("C:\Program Files\3Shape\ApplianceDesigner\ApplianceDesigner.exe") $Splintdsgnr = FileGetVersion("C:\Program Files\3Shape\SplintDesigner Splint\ApplianceDesigner.exe") $Versiontextfile = (@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt') ;Clears file from previous contents $hFile = FileOpen($Versiontextfile, 2) FileClose($hFile) ; Display the file version. This should be equal to @AutoItVersion. MsgBox($MB_SYSTEMMODAL,'3Shape Software Versions', 'Dental System: ' & $DSver &@CRLF& 'Dongle Server Service: '& $DSSver & @CRLF & 'ScanSuite: '& $ScnSvr & @CRLF & 'ScanitDental: '& $SID & @CRLF & 'Appliance Designer: '& $AppDsgnr& @CRLF & 'Splint Designer: '& $SplintDsgnr) MsgBox($MB_SYSTEMMODAL,'3Shape Software Versions', ' A summary has been saved on the desktop: ' & @CRLF & @CRLF& '" ' & @computername & ' 3shape Dental System File Versions.txt "') ;Below writes all data to text file on desktop FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','***** 3SHAPE DENTAL SYSTEM FILE VERSIONS *****') FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteLine(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt',"") FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Dental System - '& $DSver) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Dongle Server Service - '& $DSSver) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','ScanSuite - '& $ScnSvr) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Scanit Dental - '& $SID) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Appliance Designer - '& $AppDsgnr) FileWriteline(@DesktopDir &'\' & @computername & ' 3shape Dental System File Versions.txt','Splint Designer - '& $SplintDsgnr) Run("notepad.exe " & $Versiontextfile, @WindowsDir, @SW_MAXIMIZE) EndFunc
  5. with my POS work laptop with Sleep(100) it was missing a second level folder once or twice. Not sure why but when i upped it to 1000 its fine. Speed isnt critical when it might take 30 seconds at most to complete everything. at most the customers using this might only be processing 15 sets of folders, again not a huge deal. Thanks for your support, I really do appreciate it!
  6. This is all working as i need it to Thanks again, My only question is i have been looking at the @SW_HIDE command to make it not show the command windows popping up... I have tried placing it in multiple places in the @Comspec ines, unsuccessfully. #Include <File.au3> ;All code provided by VisciousXUSMC on www.autoitscript.com Local $sDirectory = @ScriptDir & "\Test" Local $aFiles = _FileListToArrayRec($sDirectory, "*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) Local $aFilesName = _FileListToArrayRec($sDirectory, "*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_NOPATH) Local $aFolders = _FileListToArrayRec($sDirectory, "*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) Local $aFoldersName = _FileListToArrayRec($sDirectory, "*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_NOPATH) If IsArray($aFiles) Then For $i = 1 to $aFiles[0] If StringRegExp($aFiles[$i],".*?_000(.3sz|.ini)?$") Then Sleep(1000) Run(@ComSpec & " /c REN " & '"' & $aFiles[$i] & '" "' & StringRegExpReplace($aFilesName[$i], "_000(.3sz|.ini)?$", "$1") & '"') EndIf Next EndIf For $i2 = 30 to 1 Step -1 For $i = 1 to $aFolders[0] If _CountStr($aFolders[$i], "\") = $i2 Then If StringRegExp($aFolders[$i],".*?_000(.3sz|.ini)?$") Then sleep(1000) Run(@ComSpec & " /c REN " & '"' & $aFolders[$i] & '" "' & StringRegExpReplace($aFoldersName[$i], "_000(.3sz|.ini)?$", "$1") & '"') EndIf EndIf Next Next Func _CountStr($sStr, $sFind) StringReplace($sStr, $sFind, $sFind) Return @Extended EndFunc ;This section of code Replaces the PCID specified by the user Local $sDirectory = @ScriptDir & "\test" Local $aFiles = _FileListToArrayRec($sDirectory, "*.ini", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) Local $sChange = InputBox("Update All .INI Files In " & $sDirectory, "Enter New PCID","204256", "", @DesktopWidth/6) For $i =1 to $aFiles[0] IniWrite($aFiles[$i], "INFO", "PCID",$sChange) Next MsgBox(48, "Process Completed!!!", "All .Ini Files and Folders Updated!")
  7. thanks looks like i have more tinkering to do then, Thank you for all of your help... the issue with not "all" the CMD prompt windows closing was an error on my part (fat fingers). I actually thought this would be easier than it is lol, guess thats why im not a software programmer! Lupas Rename 2000 does this in about 5 seconds selecting use folders as files and using recursive mode.....just a few clicks and its done but wanted to have a one stop shop solution. im not giving up ...just need to learn some more i suppose!
  8. @Jlogan3o13 I understand your concerns, i am a computer guy not a programmer however i can usually look at code and figure out what things are happening. I will and have been trying multiple things, i am more than appreciative of all of your help, i have helped on forums of different topics, obviously not programming. I will try to be more clear. @visciousXUSMC i have attached a quick screen shot of the folder structure, Again thank you all for your help. Also the file folders typically would be named the same....for this testing purposes it shouldnt matter, i just used one set of folders/files and made multiple copies of them.
  9. /c closes most but not all and its still hanging up not renaming the folders
  10. This worked renaming the files but did NOT rename the folders.... also it opened about a dozen command prompt windows...any ideas why?
  11. I will stand corrected i must have used your first bit of code earlier your INIWRITE works GREAT! i will try and test this bit of code now....
  12. in the parent directory there is a possiblity of being HUNDREDS if not thousands of files/folders named incorrectly, this is a software bug that doesnt look like it may ever get corrected. so i may have my customer copy the files he needs to rename into a separate "working" directory folder to be the "processing" folder. Yes for this script it will be ALWAYS the same format ...removing the last 4 characters from the file name. Each directory folder that will be uniquely named incrmentally like my first post will only have the 2 files in it just like my most recent post shows.
  13. Thanks you all for your quick replies.... Jlogan i was able to get your script to work great Thankyou! Viscious Your Ini Read/write idea was a great idea but i was unsuccesful in getting it to work. Now i would like to see if i can combine a separate task into this I actually need to remove the last 4 characters from the file and folder names: Right now the this is how the folders are setup: Current folder/file setup Desktop\530100_001837_000\ \530100_001837_000 530100_001837_000.3sz 530100_001837_000_000.iniNow that i can edit the internal PCID in the .ini file i also need to remove the "_000" from the folders and files. before today i was having my customer use Lupas rename and Right crop 4 characters separately but if i could make this into one functional executable it would be awesome.... i just dont know how to incorporate the StringTrimRight command into folder and file use within the current script. What i want the end results to be Desktop\530100_001837\ \530100_001837\ 530100_001837.3sz 530100_001837_000.iniThanks again for any directions or help.
  14. Hello everyone i will try to explain what i am trying to achieve here, i have been trying to figure this out on my own using help files/examples and other references with no luck. I have a file that is output everytime my customer completes a scan which is an .INI configuration settings file that looks like this.... [INFO] PCID=12345 Version=Cercon design 2.3.5.1 SerialNo=101110 Case started=1899-12-30 14:17:28 Last saved=2010-02-23 15:36:50 Data source=External scanner What i need to happen is the PCID=12345 needs to be changed to a specified 6 digit number, i could make this hard coded to just do the operation but a more generic option with Input boxes would be nice. Also when these files are created they are created with a uniquely named folder with a matching *INI file name i would like to either select the files through a dialog box or just process the *ini files in the entire folder. Folder 204567_100100 204567_100100.scan 204567_100100.ini 204567_100101 204567_100101.scan 204567_100101.ini 204567_100102 204567_100102.scan 204567_100102.ini Here is the code i have been playing with to try and get it to work, i have been successful by specifying one single file by using the example but this would be more work than just manually editing the file. But if i could automate it this would save a ton of time. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include <Constants.au3> ; *** End added by AutoIt3Wrapper *** #include <File.au3> Local $sFind = InputBox("Search for the following", "Enter the 5 Digit 3shape Site ID to be replaced", "12345") Local $sReplace = InputBox("Replace with this entry", "Enter the 6 Digit PCID to be replaced", "445566") Local $sFileName = "C:\ReplaceStringInFile.test" Local $iMsg = "This will Replace the 5 digit 3shape Site ID " & $sFind & " With the 6 Digit Cercon PCID " & $sReplace & "at the following file location " & $sFileName MsgBox($MB_SYSTEMMODAL, ":*:*:* ATTENTION *:*:*:", $iMsg) Local $iRetval =_ReplaceStringInFile($sFileName, $sFind, $sReplace) If $iRetval = -1 Then MsgBox($MB_SYSTEMMODAL, "ERROR", "The pattern could not be replaced in file: " & $sFileName & " Error: " & @error) Exit Else MsgBox($MB_SYSTEMMODAL, "INFO", "Found " & $iRetval & " occurances of the pattern: " & $sFind & " in the file: " & $sFileName) EndIf $iMsg = FileRead($sFileName, 1000) Any help or direction would be greatly appreciated! Thanks Jeremy
×
×
  • Create New...