Difference between revisions of "MS-Windows"

From wiki
Jump to: navigation, search
Line 1: Line 1:
 
Things I learned that may come in handy whenever I'm forced to go windows.
 
Things I learned that may come in handy whenever I'm forced to go windows.
  
==Command files==
+
=Command files=
 
;%1, %2
 
;%1, %2
 
:Positional parameters (like $1,$2 in unix shells)
 
:Positional parameters (like $1,$2 in unix shells)
  
 +
==Functions==
 +
<syntaxhighlight lang=dos>
 +
 +
call:do_it hi bye
 +
goto:eof
 +
 +
:do_it
 +
zip -r %bckdir%\logs.zip %a%\test
 +
echo Passed parameters %~1% and %~2%
 +
goto:eof
 +
 +
</syntaxhighlight>
 +
 +
==Timestamp==
 +
NOTE: The exact positions (what follows :~) depend on the date format set on your system. Check what <code>echo %date%</code> and <code>echo %time%</code> return.
 +
<syntaxhighlight lang=dos>
 +
 +
SET YYYY=%date:~-4,4%
 +
SET DD=%date:~-7,2%
 +
SET MM=%date:~-10,2%
 +
SET HR=%time:~0,2%
 +
SET MIN=%time:~3,2%
 +
SET SEC=%time:~6,2%
 +
SET timestamp=%YYYY%%MM%%DD%_%HR%%MIN%%SEC%
 +
 +
 +
</syntaxhighlight>
 +
 +
 +
=Errors and solutions==
 
==Found running a python program==
 
==Found running a python program==
 
;Error
 
;Error

Revision as of 14:03, 23 October 2019

Things I learned that may come in handy whenever I'm forced to go windows.

Command files

%1, %2
Positional parameters (like $1,$2 in unix shells)

Functions

call:do_it hi bye
goto:eof

:do_it
zip -r %bckdir%\logs.zip %a%\test
echo Passed parameters %~1% and %~2%
goto:eof

Timestamp

NOTE: The exact positions (what follows :~) depend on the date format set on your system. Check what echo %date% and echo %time% return.

SET YYYY=%date:~-4,4%
SET DD=%date:~-7,2%
SET MM=%date:~-10,2%
SET HR=%time:~0,2%
SET MIN=%time:~3,2%
SET SEC=%time:~6,2%
SET timestamp=%YYYY%%MM%%DD%_%HR%%MIN%%SEC%


Errors and solutions=

Found running a python program

Error
"System.Messaging.MessageQueueException: Insufficient resources to perform operation."
Reason
There are insufficient resources to perform the migration, and this is specific to the MSMQ. The size of the MSMQ itself is limited to 4MB, requests have to be within that limit.
Solution
  • Open 'Server Manager'
  • Go to the "Features" tab - under the Features tab, right-click 'Message Queueing'
  • Select "Properties"
  • On the "General" tab, un-tick 'Storage limits'

OR

  • Go to Tools - 'Computer Management'
  • Go to 'Services and Applications'
  • Open the 'Message Queuing' properties, un-tick 'Storage limits'