Last active
March 19, 2024 17:08
-
-
Save themaximax/fd2a7b16b75bec490abc280fab4201ce to your computer and use it in GitHub Desktop.
Печать на сетевой принтер без драйверов
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Авто монтирование сетевой папки | |
[Automount] | |
Where=/mnt/print | |
TimeoutIdleSec=30 | |
[Install] | |
WantedBy=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Монтирование сетевой папки | |
After=nss-lookup.target | |
[Mount] | |
Type=cifs | |
What=//goncharova-pc/share | |
Where=/mnt/share | |
Options=_netdev,iocharset=utf8,rw,file_mode=0777,dir_mode=0777,credentials=/etc/samba/smbcreds | |
TimeoutSec=10 | |
[Install] | |
WantedBy=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# указываем путь до сетевой папки печати | |
$pdir = 'C:\Share\Print' | |
if (!(Test-Path -Path $pdir)) { | |
New-Item -Path $pdir -ItemType Directory -ErrorAction Stop | |
} | |
Set-Location $pdir | |
while ($True) { | |
Get-ChildItem $pdir -Recurse -Filter "*.pdf" | | |
ForEach-Object { | |
# Write-Host "> $_" -NoNewline | |
Start-Process -FilePath $_ -Verb print -Wait | |
# Write-Host " - Готово" | |
Start-Sleep 2 | |
Remove-Item $_ | |
} | |
Start-Sleep 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment