Your help is most appreciated.
Please see what I have below. The code only executes the file append at the end and runs the software.
Code: Select all
#SingleInstance Force
FileInstall, remoteprinter.png, %temp%\remoteprinter.png, 1
FileInstall, credit.png, %temp%\credit.png, 1
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
Gui, +AlwaysOnTop
Gui Margin, 0, 0
Gui, Add, Picture, w500 h350 BackgroundTrans, %temp%\remoteprinter.png
Gui, -Caption
Gui, Add, Text, x1 y1 w500 h57 BackgroundTrans Center GuiMove,
Gui, Add, TreeView, x65 y80 w290 h125
P1 := TV_Add("Western Region - West Badging Hub")
P1C1 := TV_Add("11111 Santa Monica, Los Angeles, CA", P1) ; Specify P1 to be this item's parent.
P1C2 := TV_Add("1165 E Wilmington Ave, Salt Lake City, UT", P1)
P1C3 := TV_Add("2121 N California Blvd, Walnut Creek, CA",P1)
P1C4 := TV_Add("3145 Brookwood Pkwy(Local Printer), Hillsboro OR",P1)
P1C5 := TV_Add("301 Howard St, San Francisco, CA",P1)
P1C6 := TV_Add("9605 Scranton Rd, San Diego, CA",P1)
P2 := TV_Add("Central Region - Central Badging Hub")
P2C1 := TV_Add("1354 E Boot Road(Local Printer), Westchester PA",P2)
P2C2 := TV_Add("1407 Broadway, New York, NY", P2)
P2C3 := TV_Add("55 W 46th St, New York, NY", P2)
P2C4 := TV_Add("584 Broadway, New York, NY", P2)
P3 := TV_Add("Northeast Region - Northeast Badging Hub")
P3C1 := TV_Add("1000 2nd Ave, Seattle, WA", P3)
P3C2 := TV_Add("33 W Monroe St, Chicago, IL", P3)
P3C3 := TV_Add("4000 Port Union Rd, Hamilton, OH", P3)
P3C4 := TV_Add("6200 Bridge Point Prkwy, Austin, TX", P3)
P4 := TV_Add("International - International Badging Hub")
P4C1 := TV_Add("71-91 Alwych House, London, UK",P4)
Gui, Add, Button, x50 y268 w70 h22, OK
Gui, Add, Button, x129 y268 w130 h22, Cancel
Gui, Add, Picture, vCredit x60 y78 w385 h143 BackgroundTrans, %temp%\credit.png
Gui, Show ; Show the window and its TreeView.
GuiControl, hide ,credit
return
ESC::
GuiControl, show ,credit
Sleep 3000
GuiControl, hide ,credit
Return
F1:: Gui, Show, xCenter yCenter, Actions
Send {Click}
Sleep 100
Send {Click}
Action:
If ((A_GuiEvent = "DoubleClick") || (Trigger_Action))
{
Gui, Submit
Sleep 4000
Process, close, SAFEClient.exe
sleep 1000
Run, "C:\Program Files (x86)\Quantum Secure\SAFE Smart Client\SAFEClient.exe"
If (P1C1)
{
FileDelete, C:\Program Files (x86)\Quantum Secure\SAFE Smart Client\QSPRINTERSETTINGS.ini
FileAppend, ;
(
[PrintProperties]
Printername=11111 Santa Monica Blvd DTC1250e Card Printer
DefaultPrinter=NO
Printside=single
Orientation=Portrait
PRINTERMAP=Corporate Employee|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate Security|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate Field Identification|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Comcast Corporate Contractor|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012, Corporate Temp Intern|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate 1717 Cleaning|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate 1717 Security|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate Temp Access|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate 1800 Market Staff|11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Corporate Property Removal |11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012,Comcast Visitor Escort |11111 Santa Monica Blvd DTC1250e Card Printer|Portrait|640|1012
LandscapeDefaultSize=988,635
LandscapePictureBox=341,219
PortraitDefaultSize=657,1074
PortraitPictureBox=219,358
ReadIClass=false
Debug=false
PictureCropSize=200,250,50,0
FargoMoveInterfaceLocation=C:\Program Files\Quantum Secure\SAFE\Client\Fargo Interface\
SelectedReader=OMNIKEY CardMan 5x21-CL 0
FargoStation=4
WaitParameters=1,1,1,1,1
ReadAttemp=2,15
WriteLog=true
Duplex=4
ShowPrintDialog=false
WebBadgePrint=false
PrintFromIE=false
MoveFargo=false
SmartChipReadTest=false
HIDCardType=HIDCorp1000
SearchOmnikeyReader=false
ReadIClassEnableBadges=12723
ReadIClassDisabledBadges=12725,12729
), C:\Program Files (x86)\Quantum Secure\SAFE Smart Client\QSPRINTERSETTINGS.ini
}
If (P1C2)
{
FileDelete, C:\Program Files (x86)\Quantum Secure\SAFE Smart Client\QSPRINTERSETTINGS.ini
FileAppend, ;
(
[PrintProperties]
Printername=1165 East Wilmington Ave DTC1250e Card Printer
DefaultPrinter=NO
Printside=single
Orientation=Portrait
PRINTERMAP=Corporate Employee|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate Security|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate Field Identification|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Comcast Corporate Contractor|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012, Corporate Temp Intern|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate 1717 Cleaning|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate 1717 Security|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate Temp Access|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate 1800 Market Staff|1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Corporate Property Removal |1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012,Comcast Visitor Escort |1165 East Wilmington Ave DTC1250e Card Printer|Portrait|640|1012
LandscapeDefaultSize=988,635
LandscapePictureBox=341,219
PortraitDefaultSize=657,1074
PortraitPictureBox=219,358
ReadIClass=false
Debug=false
PictureCropSize=200,250,50,0
FargoMoveInterfaceLocation=C:\Program Files\Quantum Secure\SAFE\Client\Fargo Interface\
SelectedReader=OMNIKEY CardMan 5x21-CL 0
FargoStation=4
WaitParameters=1,1,1,1,1
ReadAttemp=2,15
WriteLog=true
Duplex=4
ShowPrintDialog=false
WebBadgePrint=false
PrintFromIE=false
MoveFargo=false
SmartChipReadTest=false
HIDCardType=HIDCorp1000
SearchOmnikeyReader=false
ReadIClassEnableBadges=12723
ReadIClassDisabledBadges=12725,12729
), C:\Program Files (x86)\Quantum Secure\SAFE Smart Client\QSPRINTERSETTINGS.ini
}
}
return
#If WinActive("Actions ahk_class AutoHotkeyGUI")
Enter::
Trigger_Action := true
GoSub, Action
Trigger_Action := false
return
ButtonOk:
Trigger_Action := true
GoSub, Action
Trigger_Action := false
return
ButtonCancel:
Gui, Hide
uiMove:
PostMessage, 0xA1, 2,,, A
Return
#If
GuiClose:
ExitApp
Sleep 100