+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
Windows Server 2008 R2 Thread, PaperCut Client won't boot on startup in Technical; We use the local cache version too. I have this set at user logon: cmd /c "start \<servername>\PCClient\win\pc-client-local-cache.exe --silent --minimized" ...
  1. #16
    Ant
    Ant is online now

    Join Date
    Feb 2008
    Posts
    90
    Thank Post
    40
    Thanked 22 Times in 17 Posts
    Rep Power
    17
    We use the local cache version too.

    I have this set at user logon:
    cmd /c "start \\<servername>\PCClient\win\pc-client-local-cache.exe --silent --minimized"

    Seems to work ok.

  2. #17

    abillybob's Avatar
    Join Date
    May 2013
    Location
    Shropshire
    Posts
    2,966
    Thank Post
    397
    Thanked 390 Times in 276 Posts
    Rep Power
    234
    Hmmm maybe I should try something different like using a script on all machines or something? Does anyone have a script I could use that can be applied via GP?

  3. #18
    Disease's Avatar
    Join Date
    Jan 2006
    Posts
    1,100
    Thank Post
    118
    Thanked 70 Times in 48 Posts
    Rep Power
    56
    We use group policy to start it up.

    Computer - Policies - Administrative Templates - System/Logon - Run these programs at user logon - c:\Program Files\PaperCut NG\pc-client.exe

    Start every time.

  4. #19

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,070
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Roll the client out using the MSI and then create a registry key in the 'Run' section of the registry to make the client run on login - that's how I've done it.

    Also edit the config.properties file and program the settings in you want the client to use, it saves having to use all those switches.

    Regards,

    Mike.

  5. #20

    abillybob's Avatar
    Join Date
    May 2013
    Location
    Shropshire
    Posts
    2,966
    Thank Post
    397
    Thanked 390 Times in 276 Posts
    Rep Power
    234
    Quote Originally Posted by Disease View Post
    We use group policy to start it up.

    Computer - Policies - Administrative Templates - System/Logon - Run these programs at user logon - c:\Program Files\PaperCut NG\pc-client.exe

    Start every time.
    Tried again won't work for me for some reason!!!

  6. #21

    Join Date
    Apr 2012
    Posts
    50
    Thank Post
    0
    Thanked 6 Times in 5 Posts
    Rep Power
    7
    Hi all,

    I should add that I'm not actually running this version of the script - I wrote this script with the aim of reducing wireless traffic starting papercut, but never got around to putting it live - tested it on my box wiht various scenarios but never went live.

    Anyway, disclaimer over, the script I came up with to run as a logon script was a vbs script as follows:

    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    PapercutPath = "\\printserver\pcclient\win"
    PapercutCachePath = "c:\cache"
    ClientArguments = " --silent --minimized --neverrequestidentity"
    
    LocalVersion = GetLocalPaperCutVersion(PapercutCachePath)
    NetworkVersion = GetNetworkPaperCutVersion(PapercutPath)
    
    Wscript.Echo "Local: " & LocalVersion
    Wscript.Echo "Network: " & NetworkVersion
    
    ClientToExecute = ""
    
    Select Case CompareVersions( NetworkVersion, LocalVersion )
    	Case -1
    		' Local Version 'newer' then network i.e. network not found
    		ClientToExecute = PapercutCachePath & "\pc-client.exe-" & LocalVersion & "\pc-client.exe"
    	Case 0
    		' Versions match, therefore local
    		ClientToExecute = PapercutCachePath & "\pc-client.exe-" & LocalVersion & "\pc-client.exe"
    	Case 1
    		'Network Update Available
    		ClientToExecute = PapercutPath & "\pc-client-local-cache.exe"
    End Select
    
    Set objFSO = CreateObject( "Scripting.FileSystemObject" )
    
    Wscript.Echo "Client To Execute: " & ClientToExecute
    If objFSO.FileExists(ClientToExecute) Then	
    	WshShell.Run ClientToExecute & " " & ClientArguments
    End If
    
    
    Function GetLocalPaperCutVersion( Path)
        Dim fs, f, f1, fc, s, Version1
        Set fs = CreateObject("Scripting.FileSystemObject")
    	Version1 = "0.0.0.0"
        if fs.FolderExists( Path ) then
    		Set f = fs.GetFolder(Path)
    		Set fc = f.SubFolders
    		For Each f1 in fc
    			If InStr(1, f1.name, "pc-client.exe-") > 0 then
    				Version2 = Replace( f1.name, "pc-client.exe-","")
    				if CompareVersions(  Version2, Version1 ) = 1  Then
    					Version1 = Version2
    				End If
    			End If
    		Next
    	End If
    	GetLocalPaperCutVersion = Version1
    End Function
    
    Function GetNetworkPaperCutVersion( Path )
        Const ForReading   = 1
    
        Dim intEqualPos
        Dim objFSO, objIniFile
        Dim strFilePath, strKey, strLeftString, strLine, strSection
    
        Set objFSO = CreateObject( "Scripting.FileSystemObject" )
    
        strFilePath = Path & "\version.txt"
    
        If objFSO.FileExists( strFilePath ) Then
            Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False )
            Do While objIniFile.AtEndOfStream = False
                strLine = Trim( objIniFile.ReadLine )
    
                ' Check if section is found in the current line
                If LCase( strLine ) = "[version]" Then
                    strLine = Trim( objIniFile.ReadLine )
    
                    ' Parse lines until the next section is reached
                    Do While Left( strLine, 1 ) <> "["
                        ' Find position of equal sign in the line
                        intEqualPos = InStr( 1, strLine, "=", 1 )
                        If intEqualPos > 0 Then
                            strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
                            ' Check if item is found in the current line
                            If LCase( strLeftString ) = "version-build" Then
                                StrBuild = Trim( Mid( strLine, intEqualPos + 1 ) )                            
                                If StrBuild = "" Then ' item exists but value is blank
                                    StrBuild = "0"
                                End If
                            End If
                            If LCase( strLeftString ) = "version-minor" Then
                                StrMinor = Trim( Mid( strLine, intEqualPos + 1 ) )                            
                                If StrMinor = "" Then ' item exists but value is blank
                                    StrMinor = "0"
                                End If
                            End If
                            If LCase( strLeftString ) = "version-major" Then
                                StrMajor = Trim( Mid( strLine, intEqualPos + 1 ) )                            
                                If StrMajor = "" Then ' item exists but value is blank
                                    StrMajor = "0"
                                End If
                            End If
                        End If
    
                        ' Abort if the end of the INI file is reached
                        If objIniFile.AtEndOfStream Then Exit Do
    
                        ' Continue with next line
                        strLine = Trim( objIniFile.ReadLine )
                    Loop
                Exit Do
                End If
            Loop
    		GetNetworkPaperCutVersion = StrMajor & "." & StrMinor & ".0." & StrBuild
            objIniFile.Close
        Else
            GetNetworkPaperCutVersion = "0.0.0.0"
        End If
    End Function
    
    ' Bitwise left shift
    Function Lsh(ByVal N, ByVal Bits)
      Lsh = N * (2 ^ Bits)
    End Function
    
    ' Returns a version string "a.b.c.d" as a two-element numeric
    ' array. The first array element is the most significant 32 bits,
    ' and the second element is the least significant 32 bits.
    Function GetVersionStringAsArray(ByVal Version)
      Dim VersionAll, VersionParts, N
      VersionAll = Array(0, 0, 0, 0)
      VersionParts = Split(Version, ".")
      For N = 0 To UBound(VersionParts)
        VersionAll(N) = CLng(VersionParts(N))
      Next
    
      Dim Hi, Lo
      Hi = Lsh(VersionAll(0), 16) + VersionAll(1)
      Lo = Lsh(VersionAll(2), 16) + VersionAll(3)
    
      GetVersionStringAsArray = Array(Hi, Lo)
    End Function
    
    ' Compares two versions "a.b.c.d". If Version1 < Version2,
    ' returns -1. If Version1 = Version2, returns 0.
    ' If Version1 > Version2, returns 1.
    Function CompareVersions(ByVal Version1, ByVal Version2)
      Dim Ver1, Ver2, Result
      Ver1 = GetVersionStringAsArray(Version1)
      Ver2 = GetVersionStringAsArray(Version2)
      If Ver1(0) < Ver2(0) Then
        Result = -1
      ElseIf Ver1(0) = Ver2(0) Then
        If Ver1(1) < Ver2(1) Then
          Result = -1
        ElseIf Ver1(1) = Ver2(1) Then
          Result = 0
        Else
          Result = 1
        End If
      Else
        Result = 1
      End If
      CompareVersions = Result
    End Function
    In theory, you only need to change the first line of the script to point to your server path i.e. set PapercutPath and ClientArguments (if you want to do something fancy)

    2nd disclaimer, some of the version check code, I pulled from google so it's not all mine.
    Last edited by minimoo; 29th August 2014 at 07:11 PM.

  7. #22

    abillybob's Avatar
    Join Date
    May 2013
    Location
    Shropshire
    Posts
    2,966
    Thank Post
    397
    Thanked 390 Times in 276 Posts
    Rep Power
    234
    @minimoo hey buddy, how do I run this script at logon? I still can't get this flaming thing to start!!

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Windows 8 won't install on Boot Camp
    By Zoom7000 in forum Mac
    Replies: 1
    Last Post: 2nd May 2013, 08:40 PM
  2. Running papercut client at startup on CC4 network
    By andyturpie in forum How do you do....it?
    Replies: 1
    Last Post: 20th November 2012, 11:57 AM
  3. Replies: 10
    Last Post: 19th January 2011, 11:57 AM
  4. My Fedora server won't boot
    By StewartKnight in forum *nix
    Replies: 7
    Last Post: 10th January 2006, 04:05 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •