Ed
Tue Jan 30 07:43:00 CST 2007
Ayush:
> That's because you are trying to run two windows, but the code only sets
> the attributes (whatever you call it) of only the last opened window..
The change I made was to comment out
'wsHl.Run "explorer.exe C:\Documents and
Settings\MyUserName\Desktop\New
Folder",0,true '****
and use instead
wsHl.Run "explorer.exe C:\Documents and Settings\MyUserName\Desktop\New
Folder",5,true '****
because the 0 did not let me see the folder, whereas the 5 (which I got from
the Help file on the Windows collection) made that window active and
visible.
I'm sorry if I'm sonfusing you with this. I'm very new at scripts and
working with Windows objects - usually I stay in VBA with Word and Excel
objects. So when the script went through
set lastWin = shA.Windows.Item(shA.Windows.Count-1)
but got to
lastWin.Width = 800 : lastWin.Height = 600
and returned the error that there was no lastWin object, I wasn't sure how
to check that or fix it.
Ed
"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:O60CLxDRHHA.1212@TK2MSFTNGP03.phx.gbl...
> Replied to [Ed]s message :
>> I am having some problems with this. I made one change:
>>
>> set wsHl= CreateObject("WScript.Shell")
>> set shA= CreateObject("Shell.Application")
>> 'wsHl.Run "explorer.exe C:\Documents and Settings\MyUserName\Desktop\New
>> Folder",0,true '****
>> wsHl.Run "explorer.exe C:\Documents and Settings\MyUserName\Desktop\New
>> Folder",5,true '****
>
>
>> I am having some problems with this.
>
>
> That's because you are trying to run two windows, but the code only sets
> the attributes (whatever you call it) of only the last opened window..
> this code will work (you can open as many windows as you want) :
>
> set wsHl= CreateObject("WScript.Shell")
> set shA= CreateObject("Shell.Application")
>
> Run "C:\FProps",0
> Run "C:\Documents and Settings\Ayush",0
>
>
> Sub Run (path,winStyle)
> wsHl.Run "explorer.exe " & path,winStyle,True
>
> set lastWin = shA.Windows.Item(shA.Windows.Count-1)
> lastWin.Width = 800 : lastWin.Height = 600
> lastWin.left = 0 : lastWin.top = 0
> lastWin.ToolBar = false : lastWin.StatusBar = False
> lastWin.Visible = True
> End Sub
>
>
> --
> ? Ayush
> -------------
> Search - www.Google.com | Wikipedia -
http://en.wikipedia.org
> Snip your long urls -
http://snipurl.com/
> -------------