Hey, Scripting Man! How can I change the size of a page file?
- HM
- HM
Now there's no way to scale the objects on the page when you change the page size. So in this case, we'd have to do some manual clean up to make it look right. Of course, in most documents, you do.
Hey, HM. You know this can be a considerably unusual question for us. Why? Because there'h a very simple and straightforward answer, which doesn't involve weird workarounds, doesn'testosterone levels need to end up being followed by a group of excuses, and works the exact same on Windows 2000 as it does on Home windows XP and Windows Machine 2003. A issue that we can simply reply to without a great deal of caveats and what-have-you? How are we supposed to performthat?!?
Well, one method might be to simply display you the code:
As you can discover, this can be a fairly regular WMI screenplay. It begins out by linking to the WMI program on the nearby computer, although merely by transforming the worth of the adjustable strComputer we would end up being able to change the page file size on a remote pc. (Just assign strComputer the title of the remote personal computer.) We after that use this series of code to come back a selection of all the page files discovered on the personal computer:
As we observed, this concern results a selection of all the page documents found on a personal computer. On the other hand, we could include a Where terms that comes back a particular page file. For illustration, this query returns just the page document settings for commute D (the file C:pagefile.sys):
Note. No, that's not a misprint: the document title, at minimum as much as the Where terms is concerned, is definitelyG:pagefile.sys. The two scars are required because the is a appropriated personality in WMI; hence we have to “escape” the personality (by doubling it up) any time we use the in a question. |
All we have to perform now will be arranged up a For Each loop in order to walk through the collection. Inside that cycle we make use of the following lines of code to change two attributes of the Get32PageFileSetting course:InitialSizeandMaximumSize. Notice that, in each case, these beliefs are portrayed in megabytes. Thus this program code sets the InitialSize to 300 megabytes and the MaximumSize to 600 megabytes:
And, whatever you perform, don't neglect that final range of program code: thePuttechnique is required to actually conserve the adjustments and enhance the size of the document. Depart out that collection of code and the software will operate just fine; you won't get an error information of any type. However, you won't change the size of the page file, either. Any time you change the value of a read/write property or home in WMI (and, yes, InitialSize and MaximumSize are read/write qualities) you must use the Put method to in fact place those changes into effect.
And that'beds it, that's all you have got to perform. But today what are we intended to perform with all these empty caveats and excuses?
Good point: nearly all likely wewillhave got a use for them quicker or later on, won't we? In reality, now that we believe about it, down the road's line could make use of a few. Ah, the pleasures of scripting on different variations of Windows ….
Groups:Adobe lllustratorln other dialects:
Espáñol:cámbiar el tamaño para are generally mesa de trabajó en Adobe lllustrator, Italiano:- Edit
- Send enthusiast mail to authors