michalek19
asked on
Printbrm.exe - backup printer objects, print drivers and printer ports
Hi
I am having problem to execute this batch file on Win2008 R 64bit
Basically, i am getting this error
C:\Users\xxxxx\Desktop>Pri ntbrm.cmd
'"C:\Windows\System32\Spoo l\Tools\Pr intBRM -B -S"' is not recognized as an inter
nal or external command,
operable program or batch file.
'"C:\Windows\System32\Spoo l\Tools\Pr intBRM -B -S"' is not recognized as an inter
nal or external command,
operable program or batch file.
'"C:\Windows\System32\Spoo l\Tools\Pr intBRM -B -S"' is not recognized as an inter
nal or external command,
operable program or batch file.
I am not sure what i am doing wrong or what is wrong with this batch script
What i want to accomplished is to pull printers objects, printer drives and printer ports from remove print server and copy to centralize server?
Can some help me out?
printbrm.cmd
I am having problem to execute this batch file on Win2008 R 64bit
Basically, i am getting this error
C:\Users\xxxxx\Desktop>Pri
'"C:\Windows\System32\Spoo
nal or external command,
operable program or batch file.
'"C:\Windows\System32\Spoo
nal or external command,
operable program or batch file.
'"C:\Windows\System32\Spoo
nal or external command,
operable program or batch file.
I am not sure what i am doing wrong or what is wrong with this batch script
What i want to accomplished is to pull printers objects, printer drives and printer ports from remove print server and copy to centralize server?
Can some help me out?
printbrm.cmd
ASKER
I am sorry, can you point me what quotation marks are you revering to
@echo off
set BkupDir=C:\temp
set PrintBRM=%windir%\System32 \Spool\Too ls\PrintBR M -B -S
call :DoBackup PRINT-fs2
call :DoBackup PRINT-fs3
call :DoBackup PRINT-f4
goto :EOF
:DoBackup [printservername]
if exist "%BkupDir%\%~1.printerExpo rt" ren "%BkupDir%\%~1.printerExpo rt" "*.bak"
"%PrintBRM%" -s \\%~1 -b -f "%BkupDir%\%~1.printerExpo rt" -O FORCE && (
if exist "%BkupDir%\%~1.bak" del "%BkupDir%\%~1.bak"
) || (
if exist "%BkupDir%\%~1.bak" ren "%BkupDir%\%~1.bak" "*.printerExport"
)
goto :EOF
@echo off
set BkupDir=C:\temp
set PrintBRM=%windir%\System32
call :DoBackup PRINT-fs2
call :DoBackup PRINT-fs3
call :DoBackup PRINT-f4
goto :EOF
:DoBackup [printservername]
if exist "%BkupDir%\%~1.printerExpo
"%PrintBRM%" -s \\%~1 -b -f "%BkupDir%\%~1.printerExpo
if exist "%BkupDir%\%~1.bak" del "%BkupDir%\%~1.bak"
) || (
if exist "%BkupDir%\%~1.bak" ren "%BkupDir%\%~1.bak" "*.printerExport"
)
goto :EOF
set PrintBRM=%windir%\System32\Spool\Too ls\PrintBR M -B -S
Should be:
set PrintBRM=%windir%\System32\Spool\Too ls\PrintBR M
And
"%PrintBRM%" -s \\%~1 -b -f "%BkupDir%\%~1.printerExport" -O FORCE
Should be
%PrintBRM% -b -s \\%~1 -f %BkupDir%\%~1.printerExport -O FORCE
ASKER
I changed it to
@echo off
set BkupDir=C:\temp
set PrintBRM=%windir%\System32 \Spool\Too ls\PrintBR M
call :DoBackup YN-CORPNT1
call :DoBackup BO-CORP1
call :DoBackup CI-CORPNT1
goto :EOF
:DoBackup [printservername]
if exist "%BkupDir%\%~1.printerExpo rt" ren "%BkupDir%\%~1.printerExpo rt" "*.bak"
"%PrintBRM% -b -s \\%~1 -f %BkupDir%\%~1.printerExpor t -O FORCE && (
if exist "%BkupDir%\%~1.bak" del "%BkupDir%\%~1.bak"
) || (
if exist "%BkupDir%\%~1.bak" ren "%BkupDir%\%~1.bak" "*.printerExport"
)
goto :EOF
but i got output as follow
C:\Printbrm.cmd
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
@echo off
set BkupDir=C:\temp
set PrintBRM=%windir%\System32
call :DoBackup YN-CORPNT1
call :DoBackup BO-CORP1
call :DoBackup CI-CORPNT1
goto :EOF
:DoBackup [printservername]
if exist "%BkupDir%\%~1.printerExpo
"%PrintBRM% -b -s \\%~1 -f %BkupDir%\%~1.printerExpor
if exist "%BkupDir%\%~1.bak" del "%BkupDir%\%~1.bak"
) || (
if exist "%BkupDir%\%~1.bak" ren "%BkupDir%\%~1.bak" "*.printerExport"
)
goto :EOF
but i got output as follow
C:\Printbrm.cmd
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is it possible to add to this batch script log files of the backed up printer objects?
and received an e-mail when the backup up is completed.
and received an e-mail when the backup up is completed.
It might be possible, but that's outside the scope of your original question. You should open up a new question to ask about adding those features to the batch file.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for michalek19's comment #a39909792
for the following reason:
Great support
I will open another ticket other question
Accepted answer: 0 points for michalek19's comment #a39909792
for the following reason:
Great support
I will open another ticket other question
ASKER
New topic
Printbrm.exe - adding log file and e-mail alert to batch file
Printbrm.exe - adding log file and e-mail alert to batch file
Instead of running:
If any of your paths had spaces or special characters in them, you'd have to deal with quotes, but it looks like you don't.
http://stackoverflow.com/questions/535975/dealing-with-quotes-in-windows-batch-scripts
Also, you doubled up the -b and -s switches, putting them both in the "PrintBRM" variable you set and the actual command.