hexagon logo

Script to make a change in all programs?

All of our programs are set up to automatically save reports to a specific directory based on part number. IT has decided they need to re-map our entire network which means I need to edit all of our programs to save reports according to the new network mapping scheme. Is it possible to use a script for this task? If so, does anyone have an example of how to do this?
Parents
  • Question: are the paths hard-coded in the File- Printing - Report Window Setup, or are they hard-coded in a Print Command?


    By the way N3WPV, do you have any experience scripting in something outside of PC-DMIS (i.e. VB.NET/VBA/VBScript/Powershell/etc.)? If you give us an example of what commands/values you're trying to modify, we could probably help you write something.




    I have a Print Command at the end of each program that saves the report to a specific folder based on part number with a filename based on user input data.

    PRINT/REPORT,EXEC MODE=END,$              
    TO_FILE=ON,OVERWRITE="[COLOR=#ff0000]J[/COLOR]:\Quality\Enginetics Part Numbers\5000 - 5999\5307188-01\CMM Reports\5307188-01 - Lot "+ LOT +" - #"+ SERNUM +".rtf",$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=KEEP_INSTANCES



    Everything on our "J" drive has been moved to the "S" drive. I wasn't sure if a script to change this was possible since PCD programs are not true text files, unless I'm mistaken. If a script is possible I do not know how to do it. I've taken scripts here and studied how they work and have been able to modify them to meet my needs but to create one from scratch is above me.

    I also have some other commands I may need to modify ie., scripts, stats, custom data exports, etc. Being able to use a script to do a global "find...replace" would be a big time saver! I like the idea of reading in a text file for path structure and will look into this.
Reply
  • Question: are the paths hard-coded in the File- Printing - Report Window Setup, or are they hard-coded in a Print Command?


    By the way N3WPV, do you have any experience scripting in something outside of PC-DMIS (i.e. VB.NET/VBA/VBScript/Powershell/etc.)? If you give us an example of what commands/values you're trying to modify, we could probably help you write something.




    I have a Print Command at the end of each program that saves the report to a specific folder based on part number with a filename based on user input data.

    PRINT/REPORT,EXEC MODE=END,$              
    TO_FILE=ON,OVERWRITE="[COLOR=#ff0000]J[/COLOR]:\Quality\Enginetics Part Numbers\5000 - 5999\5307188-01\CMM Reports\5307188-01 - Lot "+ LOT +" - #"+ SERNUM +".rtf",$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=KEEP_INSTANCES



    Everything on our "J" drive has been moved to the "S" drive. I wasn't sure if a script to change this was possible since PCD programs are not true text files, unless I'm mistaken. If a script is possible I do not know how to do it. I've taken scripts here and studied how they work and have been able to modify them to meet my needs but to create one from scratch is above me.

    I also have some other commands I may need to modify ie., scripts, stats, custom data exports, etc. Being able to use a script to do a global "find...replace" would be a big time saver! I like the idea of reading in a text file for path structure and will look into this.
Children
No Data