dot45 Posted June 8, 2009 Posted June 8, 2009 I am new to autoit, but so far i really like it. Here is what i am trying to do. I have multiple .cab files out on the network, each one contains a different set of settings/drivers for the "printmig" tool that microsoft has. I want to have a dialog box open up and let the technician pick the file to pass into the script. I've looked through the help file, but am not finding anything to point me in the right direction. expandcollapse popup$PMap = DriveMapGet ("Z:") If $PMap = "" Then Else MsgBox(0,"A mapping was detected on Z:",$PMap,2) EndIf MsgBox(0,"Removing Existing Mapping",$PMap,1) DriveMapDel ("Z:") MsgBox(0,"Mapping Printer Migration Location","\\Server_name\Shared\PMig",1) DriveMapAdd("Z:","\\server_ip\Shared\PMig",0,"domain\user","password") $folder="Z:\printer\printmig.exe" IF FileExists($folder) Then msgbox (0,"Printer tool Found","Proper files found on the network",1) Else msgbox (0,"Printer tool not found","Please validate network connectivity - printer tool not detected",1) exit EndIf $BLD = InputBox ("Enter Building or Department", "Enter a file descriptor for the log file") MsgBox(0, "Saving Current printer settings","Backing up current configuration to the network",1) If $SystemRoot = "C:\WINNT" Then RunWait(@COMSPEC & " /c c:\winnt\System32\cscript.exe Z:\printer\prnmngr.vbs -l > Z:\"& $BLD &"_%computername%.txt") Else RunWait(@COMSPEC & " /c c:\windows\System32\cscript.exe Z:\printer\prnmngr.vbs -l > Z:\"& $BLD &"_%computername%.txt") EndIf RunWait(@COMSPEC & " /c Z:\printer\printmig.exe -b Z:\"& $BLD &"_%computername%.cab") MsgBox(0,"Removing all Printers","Please wait - Uninstalling local printers",1) If $SystemRoot = "C:\WINNT" Then RunWait(@COMSPEC & " /c c:\winnt\System32\cscript.exe Z:\printer\prnmngr.vbs -x") Else RunWait(@COMSPEC & " /c c:\windows\System32\cscript.exe Z:\printer\prnmngr.vbs -x") EndIf MsgBox(0,"Installing New Printer Settings","New printer configuration being installed",1) RunWait(@COMSPEC & " /c Z:\printer\printmig.exe -r Z:\printer\myprinters.cab -o") DriveMapDel ("Z:") MsgBox(0,"Restoring Previous Mapping",$PMap,1) DriveMapAdd("Z:",$PMap) MsgBox(0,"Migration Completed","You may need to reboot to see the new printers") exit Tools I've Created & Shared[/url][url="http://www.autoitscript.com/forum/index.php?showtopic=97177&st=0&p=698665&hl=printer&fromsearch=1&#entry698665"]Printer Migration Tool
KaFu Posted June 8, 2009 Posted June 8, 2009 Check out the function FileOpenDialog(). OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
dot45 Posted June 8, 2009 Author Posted June 8, 2009 Check out the function FileOpenDialog().how do i pass the selection to the script though? Tools I've Created & Shared[/url][url="http://www.autoitscript.com/forum/index.php?showtopic=97177&st=0&p=698665&hl=printer&fromsearch=1&#entry698665"]Printer Migration Tool
Developers Jos Posted June 8, 2009 Developers Posted June 8, 2009 how do i pass the selection to the script though?What did the Helpfile tell you about that question? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
dot45 Posted June 8, 2009 Author Posted June 8, 2009 how do i pass the selection to the script though?I think i got it, I just have to set a variable and equal it to the fileopendialog. Tools I've Created & Shared[/url][url="http://www.autoitscript.com/forum/index.php?showtopic=97177&st=0&p=698665&hl=printer&fromsearch=1&#entry698665"]Printer Migration Tool
dot45 Posted June 8, 2009 Author Posted June 8, 2009 What did the Helpfile tell you about that question?I was making it harder than it needed to be. DOH! Tools I've Created & Shared[/url][url="http://www.autoitscript.com/forum/index.php?showtopic=97177&st=0&p=698665&hl=printer&fromsearch=1&#entry698665"]Printer Migration Tool
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