Sorry for the triple post, however if I didn't it wouldn't show up as a new post for you to read. Marcus advised that v9 is no longer supported, but it does work in v11 for some reason.
Code: Select all
// COMPILE_OPTS|C:\Documents and Settings\Michael Allen\Desktop\CSU.Com.Tools.v2.9.exe|G:\Icons\TransportSA.ico|CONSOLE=0|INCLUDES=1| /LOGFILE=\dev\nul /NOSYSTRAY /NOSTOPKEY /NOSYSTRAY /LOGFILE=\dev\nul /NOSYSTRAY /HIDE /NOSTOPKEY /HIDE /NOSTOPKEY /LOGFILE=\dev\nul
Let>APP_TITLE=COM Tools v2.9
NumOn
Dialog>COMTOOLS
Caption=%APP_TITLE%
Width=353
Height=193
Top=CENTER
Left=CENTER
Max=0
Min=0
Close=1
Resize=0
Edit=COM,8,8,329,
Button=SCCM Connect,8,32,105,25,8
Button=Ping,120,32,105,25,3
Button=Up Time,232,32,105,25,4
Button=Network Drive,8,64,105,25,5
Button=Trumps IP / MAC,120,64,105,25,6
Button=Brian Enq,232,64,105,25,7
Button=Kill Knet,8,96,105,25,9
Button=Comp Manage,120,96,105,25,10
Button=Logged On User,232,96,105,25,11
Button=Fix Spoolsv Crash,8,128,105,25,12
Button=Exit,120,128,105,25,2
Label=Michael Allen © 2010,232,137,true
Label=Written By,285,125,true
Default=SCCM Connect
EndDialog>COMTOOLS
Show>COMTOOLS
Label>ActionLoop
GetDialogAction>COMTOOLS,r
if>r=2,Exit
if>r=3,Ping
if>r=4,UpTime
if>r=5,Map
if>r=6,IPMAC
if>r=7,Brian
if>r=8,SCCMConnect
if>r=9,KnetKill
if>r=10,CompMang
if>r=11,CompUser
if>r=12,SpoolSV
Wait>1
Goto>ActionLoop
SRT>LengthCheck
Length>%COMTOOLS.COM%,Len
If>%Len%=4
Let>COMTOOLS.COM=COM%COMTOOLS.COM%
Else
EndIf
End>LengthCheck
Label>Ping
CloseDialog>COMTOOLS
Gosub>LengthCheck
Let>RP_WAIT=1
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Run Program>cmd /c ping %COMTOOLS.COM% -t -l 1024
Let>RP_WAIT=0
Show>COMTOOLS
ResetDialogAction>COMTOOLS
NumOn
Goto>ActionLoop
Label>UpTime
CloseDialog>COMTOOLS
Gosub>LengthCheck
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Run Program>cmd /c systeminfo /s %COMTOOLS.COM% | find "Up Time" > %TEMP_DIR%COMTOOLSUpTimeOutput.txt
ReadFile>%TEMP_DIR%COMTOOLSUpTimeOutput.txt,UpTimeResults
MessageModal>UpTimeResults
DeleteFile>%TEMP_DIR%COMTOOLSUpTimeOutput.txt
Let>RP_WAIT=0
Let>RP_WINDOWMODE=1
Show>COMTOOLS
ResetDialogAction>COMTOOLS
NumOn
Goto>ActionLoop
Label>Map
Gosub>LengthCheck
Let>RP_WINDOWMODE=3
Run Program>%WIN_DIR%\explorer.exe \\%COMTOOLS.COM%\C$
Let>RP_WINDOWMODE=1
ResetDialogAction>COMTOOLS
NumOn
Goto>ActionLoop
Label>IPMAC
CloseDialog>COMTOOLS
Gosub>LengthCheck
//Gets IP Address
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Run Program>cmd /c PING %COMTOOLS.COM% > %TEMP_DIR%IPOutput.txt
ReadLn>%TEMP_DIR%IPOutput.txt,4,IPLine4
MidStr>%IPLine4%,12,15,IPADDRESS
StringReplace>%IPADDRESS%,b,,IPADDRESS
StringReplace>%IPADDRESS%,y,,IPADDRESS
StringReplace>%IPADDRESS%,t,,IPADDRESS
StringReplace>%IPADDRESS%,:,,IPADDRESS
StringReplace>%IPADDRESS%, ,,IPADDRESS
//Gets MAC Address
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Run Program>cmd /c GETMAC /s %COMTOOLS.COM% /FO CSV > %TEMP_DIR%MACOutput.txt
ReadLn>%TEMP_DIR%MACOutput.txt,3,Line3
MidStr>%Line3%,2,17,MACADDRESS
MessageModal>COM Number: %COMTOOLS.COM%%CRLF%IP Address: %IPADDRESS%%CRLF%MAC Address: %MACADDRESS%
DeleteFile>%TEMP_DIR%IPOutput.txt
DeleteFile>%TEMP_DIR%MACOutput.txt
Let>RP_WAIT=0
Let>RP_WINDOWMODE=1
Show>COMTOOLS
ResetDialogAction>COMTOOLS
NumOn
Goto>ActionLoop
Label>Brian
Gosub>LengthCheck
Let>RP_WINDOWMODE=3
MidStr>%COMTOOLS.COM%,4,4,COMNUM
Run Program>C:\Program Files\Internet Explorer\IEXPLORE.EXE http://webapps/brianenq/AssetDetails.asp?asset=COM-%COMNUM%
Let>RP_WINDOWMODE=1
ResetDialogAction>COMTOOLS
NumOn
Goto>ActionLoop
Label>SCCMConnect
CloseDialog>COMTOOLS
Gosub>LengthCheck
Let>RP_WAIT=0
IfFileExists>C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\i386\rc.exe
Run Program>"C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\i386\rc.exe" 1 %COMTOOLS.COM% \\DTEISMSP01
Let>WW_TIMEOUT=30
ResetDialogAction>COMTOOLS
NumOn
Show>COMTOOLS
WaitWindowOpen>Configuration Manager Remote Control*
Wait>0.5
WindowAction>1,Configuration Manager Remote Control*
SetFocus>Configuration Manager Remote Control*
Goto>ActionLoop
Else
MessageModal>SCCM Client Is Not Installed%CRLF%Please Install Client%CRLF%%CRLF%"C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\i386\rc.exe"
ResetDialogAction>COMTOOLS
NumOn
Show>COMTOOLS
Goto>ActionLoop
Endif
ResetDialogAction>COMTOOLS
NumOn
Show>COMTOOLS
Goto>ActionLoop
Label>KnetKill
CloseDialog>COMTOOLS
GoSub>LengthCheck
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Run Program>cmd /c Taskkill /S %COMTOOLS.COM% /F /IM DM.exe > %TEMP_DIR%Output1.txt
ReadFile>%TEMP_DIR%Output1.txt,Output1
Run Program>cmd /c Taskkill /S %COMTOOLS.COM% /F /IM Interceptor.exe > %TEMP_DIR%Output2.txt
ReadFile>%TEMP_DIR%Output2.txt,Output2
Run Program>cmd /c Taskkill /S %COMTOOLS.COM% /F /IM PAPIHost.exe > %TEMP_DIR%Output3.txt
ReadFile>%TEMP_DIR%Output3.txt,Output3
Let>RP_WINDOWMODE=1
Let>RP_WAIT=0
Let>MSG_HEIGHT=300
Let>MSG_WIDTH=600
MessageModal>Kill Process Output Of DM.exe%CRLF%%Output1%%CRLF%%CRLF%Kill Process Output Of Interceptor.exe%CRLF%%Output2%%CRLF%%CRLF%Kill Process Output Of PAPIHost.exe%CRLF%%Output3%
DeleteFile>%TEMP_DIR%Output1.txt
DeleteFile>%TEMP_DIR%Output2.txt
DeleteFile>%TEMP_DIR%Output3.txt
Show>COMTOOLS
ResetDialogAction>COMTOOLS
NumOn
Goto>ActionLoop
Label>CompMang
Gosub>LengthCheck
Let>RP_WAIT=0
Let>RP_WINDOWMODE=0
Run Program>cmd /c compmgmt.msc /computer=\\%COMTOOLS.COM%
ResetDialogAction>COMTOOLS
NumOn
Show>COMTOOLS
Goto>ActionLoop
Label>CompUser
Gosub>LengthCheck
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Run Program>cmd /c WMIC /NODE:%COMTOOLS.COM% COMPUTERSYSTEM GET USERNAME > %TEMP_DIR%COMTOOLSUsernameOutput.txt
ReadFile>%TEMP_DIR%COMTOOLSUsernameOutput.txt,UsernameResults
MessageModal>UsernameResults
DeleteFile>%TEMP_DIR%COMTOOLSUsernameOutput.txt
Let>RP_WAIT=0
Let>RP_WINDOWMODE=1
ResetDialogAction>COMTOOLS
NumOn
Show>COMTOOLS
Goto>ActionLoop
Label>SpoolSV
Gosub>LengthCheck
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Run Program>cmd /c sc \\%COMTOOLS.COM% stop spooler
Message>Stopping Printer Spooler Service On %COMTOOLS.COM%
Label>SpoolSV1
Wait>1
DeleteFolder>\\%COMTOOLS.COM%\c$\WINDOWS\system32\spool\PRINTERS
IfDirExists>\\%COMTOOLS.COM%\c$\WINDOWS\system32\spool\PRINTERS
Goto>SpoolSV1
Else
Message>Stopping Printer Spooler Service On %COMTOOLS.COM%%CRLF%%CRLF%Deleting Corupt Print Documents On %COMTOOLS.COM%
CreateDir>\\%COMTOOLS.COM%\c$\WINDOWS\system32\spool\PRINTERS
Run Program>cmd /c sc \\%COMTOOLS.COM% start spooler
MessageModal>Stopping Printer Spooler Service On %COMTOOLS.COM%%CRLF%%CRLF%Deleting Corupt Print Documents On %COMTOOLS.COM%%CRLF%%CRLF%Starting Printer Spooler Service On %COMTOOLS.COM%%CRLF%%CRLF%Printer Service Has Been Stopped, Corupt Print Jobs Deleted & Print Service Restored. If The User Is Still Having Issues, Then Please Attempt Process Manually.
Let>RP_WAIT=0
Let>RP_WINDOWMODE=1
ResetDialogAction>COMTOOLS
NumOn
Show>COMTOOLS
Goto>ActionLoop
Endif
Label>Exit
CloseDialog>COMTOOLS
NumOn
Thats the script, when I run the button for username I get the username returned with other data from the script, I can't work out why.
I cant work out why the script reads part of the MAC Address Label when its run, I couldn't see any loops that would cause it.
The output for the username part shows invalid characters in MS, but not in notepad when the file is written.
Any help would be greatly appreciated.