![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | bat to vbs I have a bat file that works great. The problem is my company wants only VBS so when the user logs on it will not open a command prompt. I need to convert it so it will run silently with no box popping up. I relay need to learn VBS. It copies the users NK2 file to a network share at log on. It works with Vista and XP as we use both. Below is my bat file. Can anyone convert this to a VBS so it runs silently? Thanks REM -----------------------Start of bat file if exist \\servername\nk2$\%username% del /q \\servername\nk2$\ %username% MD \\servername\nk2$\%username% IF EXIST C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\*.nk2 copy C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\*.nk2 \ \servername\nk2$\%username%\*.nk2 if exist "C:\Documents and Settings\%username%\Application Data \Microsoft\Outlook\*.nk2" copy "C:\Documents and Settings\%username% \Application Data\Microsoft\Outlook\*.nk2" \\servername\nk2$\%username% \*.nk2 REM ---------------------End of bat file Thanks again |
My System Specs![]() |
| | #2 (permalink) |
| | Re: bat to vbs ronald wrote: Quote: > Can anyone convert this to a VBS so it runs silently? > The FileSystemObject has a FileExists function and a CreateFolder method (comparable with makeDirectory). cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: bat to vbs ronald wrote: Quote: > I have a bat file that works great. The problem is my company wants > only VBS so when the user logs on it will not open a command prompt. > I need to convert it so it will run silently with no box popping up. > I relay need to learn VBS. > It copies the users NK2 file to a network share at log on. It works > with Vista and XP as we use both. > Below is my bat file. > Can anyone convert this to a VBS so it runs silently? > > Thanks > REM -----------------------Start of bat file > > if exist \\servername\nk2$\%username% del /q \\servername\nk2$\ > %username% > > MD \\servername\nk2$\%username% > > IF EXIST C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\*.nk2 > copy C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\*.nk2 \ > \servername\nk2$\%username%\*.nk2 > > if exist "C:\Documents and Settings\%username%\Application Data > \Microsoft\Outlook\*.nk2" copy "C:\Documents and Settings\%username% > \Application Data\Microsoft\Outlook\*.nk2" \\servername\nk2$\%username% > \*.nk2 > > REM ---------------------End of bat file shortcut to the batch in the startup folder (instead of the batch) and set it to run minimized? This feature has been around since Windows 3 but nobody seems to use it. Personally, I would reduce the batch rather then create a vbs. REM -----------------------Start of bat file del /q \\servername\nk2$\%username%\*nk2 copy "C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\*.nk2" \\servername\nk2$\%username%*.nk2 copy "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\*.nk2" \\servername\nk2$\%username%\*.nk2 REM ---------------------End of bat file -- Todd Vargo (Post questions to group only. Remove "z" to email personal messages) |
My System Specs![]() |
| | #4 (permalink) |
| 32 Bit Vista Ultimate | Re: bat to vbs How do you make the batch file run minimised? |
My System Specs![]() |
| | #5 (permalink) |
| | Re: bat to vbs jammmie999" wrote: Quote: > > How do you make the batch file run minimised? shortcut is created, you right click it and select properties. Now explore it's tabbed properties dialog for an option called "Run" and set it to minimized and press "OK". |
My System Specs![]() |
| | #6 (permalink) |
| 32 Bit Vista Ultimate | Re: bat to vbs jammmie999" wrote: Quote: > > How do you make the batch file run minimised? shortcut is created, you right click it and select properties. Now explore it's tabbed properties dialog for an option called "Run" and set it to minimized and press "OK". @echo off start /min C:\test.bat exit for example from another bat file. |
My System Specs![]() |
| | #7 (permalink) |
| | Re: bat to vbs "mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message news:OxL$m7YAKHA.1248@xxxxxx Quote: > > > ronald wrote: Quote: >> Can anyone convert this to a VBS so it runs silently? >> > hi Ronald, > > The FileSystemObject has a FileExists function and a > CreateFolder method (comparable with makeDirectory). the batch file in such a way that no command window is created. See the intWindowStyle argument here: http://msdn.microsoft.com/en-us/libr...ky(VS.85).aspx /Al |
My System Specs![]() |
| | #8 (permalink) |
| | Re: bat to vbs "jammmie999" <guest@xxxxxx-email.com> wrote in message news:756a3bfdce61a8175784727c1d11559f@xxxxxx-gateway.com... Quote: > > Todd Vargo;1087616 Wrote: Quote: >> jammmie999" wrote:> > > Quote: >> > > >> > > How do you make the batch file run minimised? > > First you create a >> > > shortcut to the batch (use Windows Help system). >> shortcut is created, you right click it and select properties. Now >> explore >> it's tabbed properties dialog for an option called "Run" and set it >> to >> minimized and press "OK". > Thank you /Al |
My System Specs![]() |
| | #9 (permalink) |
| | Re: bat to vbs Al Dunbar wrote: Quote: > "jammmie999" <guest@xxxxxx-email.com> wrote in message > news:756a3bfdce61a8175784727c1d11559f@xxxxxx-gateway.com... Quote: >> >> Todd Vargo;1087616 Wrote: Quote: >>> jammmie999" wrote:> > > >>>>> >>>>> How do you make the batch file run minimised? > > First you >>>>> create a shortcut to the batch (use Windows Help system). >>> Once >>> shortcut is created, you right click it and select properties. Now >>> explore >>> it's tabbed properties dialog for an option called "Run" and set it >>> to >>> minimized and press "OK". >> Thank you > If this is a logon script, I am not sure how you can do it this way... Please elucidate on what you are not sure about so we are on the same page. -- Todd Vargo (Post questions to group only. Remove "z" to email personal messages) |
My System Specs![]() |
| | #10 (permalink) |
| | Re: bat to vbs "Todd Vargo" <tlvargo@xxxxxx> wrote in message news:#VpBKI7BKHA.4792@xxxxxx Quote: > Al Dunbar wrote: Quote: >> "jammmie999" <guest@xxxxxx-email.com> wrote in message >> news:756a3bfdce61a8175784727c1d11559f@xxxxxx-gateway.com... Quote: >>> >>> Todd Vargo;1087616 Wrote: >>>> jammmie999" wrote:> > > >>>>>> >>>>>> How do you make the batch file run minimised? > > First you >>>>>> create a shortcut to the batch (use Windows Help system). >>>> Once >>>> shortcut is created, you right click it and select properties. Now >>>> explore >>>> it's tabbed properties dialog for an option called "Run" and set it >>>> to >>>> minimized and press "OK". >>> >>> Thank you >> If this is a logon script, I am not sure how you can do it this way... > jammmie999 asked a seperate question from OP. Quote: > Please elucidate on what you are not sure about so we are on the same > page. question which seemed to me to be in the context of a logon script. He said: "I have a bat file that works great. The problem is my company wants only VBS so when the user logs on it will not open a command prompt." In retrospect I suppose it is possible that he is talking about running a script from the startup folder in the start menu, in which case a shortcut would work perfectly well. It just hadn't occurred to me that that was the context (even though you explicitly referred to the possibility), as domain-based logon scripts are easier to manage. And when they do run, you are connected to the network, and not logging in locally with cached credentials. I think you and I are on the same page now, I'm just not sure about the OP... /Al |
My System Specs![]() |