text
stringlengths
0
4.23k
prompt $d$s$s$t$_$g
The prompt is changed as follows, where the date and time are current:
Fri 06/01/2007 13:53:28.91
To set the command prompt to display as an arrow (-->), type:
-->
prompt --$g
To manually change the command prompt to the default setting (the current drive and path followed by the greater than sign), type:
prompt $p$g
pubprn
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Publishes a printer to the Active Directory Domain Services. This command is a Visual Basic script located in the %WINdir%\System32\printing_Admin_Scripts\<language> directory. To use this command at a command prompt, type cscript followed by the full path to the pubprn file, or change directories to the appropriate folder. For example: cscript %WINdir%\System32\printing_Admin_Scripts\en-US\pubprn.
%WINdir%\System32\printing_Admin_Scripts\<language>
cscript %WINdir%\System32\printing_Admin_Scripts\en-US\pubprn
Syntax
cscript pubprn {<servername> | <UNCprinterpath>} LDAP://CN=<container>,DC=<container>
Parameters
Parameter
Description
<servername>
Specifies the name of the Windows server that hosts the printer that you want to publish. If you don't specify a computer, the local computer is used.
<UNCprinterpath>
The Universal Naming Convention (UNC) path to the shared printer that you want to publish.
LDAP://CN=<Container>,DC=<Container>
Specifies the path to the container in Active Directory Domain Services where you want to publish the printer.
/?
Displays help at the command prompt.
<servername>
<UNCprinterpath>
LDAP://CN=<Container>,DC=<Container>
Remarks
Examples
To publish all printers on the \Server1 computer to the MyContainer container in the MyDomain.company.com domain, type:
cscript pubprn Server1 LDAP://CN=MyContainer,DC=MyDomain,DC=company,DC=Com
To publish the Laserprinter1 printer on the \\Server1 server to the MyContainer container in the MyDomain.company.com domain, type:
cscript pubprn \\Server1\Laserprinter1 LDAP://CN=MyContainer,DC=MyDomain,DC=company,DC=Com
pushd
Stores the current directory for use by the popd command, and then changes to the specified directory.
Every time you use the pushd command, a single directory is stored for your use. However, you can store multiple directories by using the pushd command multiple times. The directories are stored sequentially in a virtual stack, so if you use the pushd command once, the directory in which you use the command is placed at the bottom of the stack. If you use the command again, the second directory is placed on top of the first one. The process repeats every time you use the pushd command.
If you use the popd command, the directory on the top of the stack is removed and the current directory is changed to that directory. If you use the popd command again, the next directory on the stack is removed. If command extensions are enabled, the popd command removes any drive-letter assignment created by the pushd command.
Syntax
pushd [<path>]
Parameters
Parameter
Description
<path>
Specifies the directory to make the current directory. This command supports relative paths.
/?
Displays help at the command prompt.
<path>
Remarks
If command extensions are enabled, the pushd command accepts either a network path or a local drive letter and path.
If you specify a network path, the pushd command temporarily assigns the highest unused drive letter (starting with Z:) to the specified network resource. The command then changes the current drive and directory to the specified directory on the newly assigned drive. If you use the popd command with command extensions enabled, the popd command removes the drive-letter assignment created by pushd.
Examples
To change the current directory from the one in which the batch program was run, and then to change it back:
@echo off
rem This batch file deletes all .txt files in a specified directory
pushd %1
del *.txt
popd
cls
echo All text files deleted in the %1 directory
pushprinterconnections
Reads Deployed Printer Connection settings from Group Policy and deploys/removes printer connections as needed.
Important
This utility is for use in machine startup or user logon scripts, and shouldn't be run from the command line.
Syntax