Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Scripts in Vista

HTVi
TV Discussion Newsgroups

Scripts in Vista
Trying to Learn 4/28/2007 3:06:01 PM
Hi,

I was trying to write a simple batch file in Vista, and discovered that I
need to do these tasks in the form of a script. I have no experience with
scripts. I felt pretty fortunate that I could get things done using batch
files. I'm an old DOS guy. This is the task I need automated .....

del c:\users\public\public~1\cqgnet\temp\*.*
del c:\users\public\public~1\cqgnet\private\bourtov.*

I have tried to no avail to convert this to a script. Any help would be
deeply appreciated as I would learn a lot if I saw it in script.

Thank you ... Sam
Re: Scripts in Vista
"CreateWindow" <createwindow[ at ]gmail.com> 5/2/2007 12:42:37 PM
Hi,

Something like this should work.

delstr1 = "cmd /c del c:\users\public\public~1\cqgnet\temp\*.*"
delstr2 = "cmd /c del c:\users\public\public~1\cqgnet\private\bourtov.*"

Set WshShell = WScript.CreateObject("WScript.Shell")
ExitCode = WshShell.Run(delstr1, 10, TRUE )
ExitCode = WshShell.Run(delstr2, 10, TRUE )
Set WshShell = Nothing

You can test the ExitCode if you like. I think the above is ok - anyway it
will get you started.

CreateWindow
http://justpageprobe.com
The FREE Web page utility you always wanted.
Keep your router connected.
Email your IP to where you need it.
Monitor your enterprise Web Servers.


"Trying to Learn" <Trying to Learn[ at ]discussions.microsoft.com> wrote in
message news:7CA962B7-EC33-422E-B4FF-E83A84760728[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> I was trying to write a simple batch file in Vista, and discovered that I
> need to do these tasks in the form of a script. I have no experience with
> scripts. I felt pretty fortunate that I could get things done using batch
> files. I'm an old DOS guy. This is the task I need automated .....
>
> del c:\users\public\public~1\cqgnet\temp\*.*
> del c:\users\public\public~1\cqgnet\private\bourtov.*
>
> I have tried to no avail to convert this to a script. Any help would be
> deeply appreciated as I would learn a lot if I saw it in script.
>
> Thank you ... Sam


Re: Scripts in Vista
Trying to Learn 5/2/2007 4:00:00 PM
Thanks for your response. I am still having a problem, but have a question.

When I typed the path to the files I want to delete I used a sub directory
called public~1. If I typed the complete name it would have been ... public
documents. The problem is that I have 4 other sub directories starting with
public.

In Vista I have .....

Public Documents (what I need to path to)
Public Downloads
Public Music
Public Pictures
Public Videos

That is why I used public~1 (I tried 2,3,4,5 also with no luck)

Was that right?


"CreateWindow" wrote:

[Quoted Text]
> Hi,
>
> Something like this should work.
>
> delstr1 = "cmd /c del c:\users\public\public~1\cqgnet\temp\*.*"
> delstr2 = "cmd /c del c:\users\public\public~1\cqgnet\private\bourtov.*"
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
> ExitCode = WshShell.Run(delstr1, 10, TRUE )
> ExitCode = WshShell.Run(delstr2, 10, TRUE )
> Set WshShell = Nothing
>
> You can test the ExitCode if you like. I think the above is ok - anyway it
> will get you started.
>
> CreateWindow
> http://justpageprobe.com
> The FREE Web page utility you always wanted.
> Keep your router connected.
> Email your IP to where you need it.
> Monitor your enterprise Web Servers.
>
>
> "Trying to Learn" <Trying to Learn[ at ]discussions.microsoft.com> wrote in
> message news:7CA962B7-EC33-422E-B4FF-E83A84760728[ at ]microsoft.com...
> > Hi,
> >
> > I was trying to write a simple batch file in Vista, and discovered that I
> > need to do these tasks in the form of a script. I have no experience with
> > scripts. I felt pretty fortunate that I could get things done using batch
> > files. I'm an old DOS guy. This is the task I need automated .....
> >
> > del c:\users\public\public~1\cqgnet\temp\*.*
> > del c:\users\public\public~1\cqgnet\private\bourtov.*
> >
> > I have tried to no avail to convert this to a script. Any help would be
> > deeply appreciated as I would learn a lot if I saw it in script.
> >
> > Thank you ... Sam
>
>
>
Re: Scripts in Vista
"CreateWindow" <createwindow[ at ]gmail.com> 5/2/2007 11:24:33 PM
Hi,

That was probably not right.
What about specifying the full name?

CreateWindow



"Trying to Learn" <TryingtoLearn[ at ]discussions.microsoft.com> wrote in message
news:AE02C341-B21D-41C7-ACBC-DC8BCB3A62E9[ at ]microsoft.com...
[Quoted Text]
> Thanks for your response. I am still having a problem, but have a
> question.
>
> When I typed the path to the files I want to delete I used a sub directory
> called public~1. If I typed the complete name it would have been ...
> public
> documents. The problem is that I have 4 other sub directories starting
> with
> public.
>
> In Vista I have .....
>
> Public Documents (what I need to path to)
> Public Downloads
> Public Music
> Public Pictures
> Public Videos
>
> That is why I used public~1 (I tried 2,3,4,5 also with no luck)
>
> Was that right?
>
>
> "CreateWindow" wrote:
>
>> Hi,
>>
>> Something like this should work.
>>
>> delstr1 = "cmd /c del c:\users\public\public~1\cqgnet\temp\*.*"
>> delstr2 = "cmd /c del c:\users\public\public~1\cqgnet\private\bourtov.*"
>>
>> Set WshShell = WScript.CreateObject("WScript.Shell")
>> ExitCode = WshShell.Run(delstr1, 10, TRUE )
>> ExitCode = WshShell.Run(delstr2, 10, TRUE )
>> Set WshShell = Nothing
>>
>> You can test the ExitCode if you like. I think the above is ok - anyway
>> it
>> will get you started.
>>
>> CreateWindow
>> http://justpageprobe.com
>> The FREE Web page utility you always wanted.
>> Keep your router connected.
>> Email your IP to where you need it.
>> Monitor your enterprise Web Servers.
>>
>>
>> "Trying to Learn" <Trying to Learn[ at ]discussions.microsoft.com> wrote in
>> message news:7CA962B7-EC33-422E-B4FF-E83A84760728[ at ]microsoft.com...
>> > Hi,
>> >
>> > I was trying to write a simple batch file in Vista, and discovered that
>> > I
>> > need to do these tasks in the form of a script. I have no experience
>> > with
>> > scripts. I felt pretty fortunate that I could get things done using
>> > batch
>> > files. I'm an old DOS guy. This is the task I need automated .....
>> >
>> > del c:\users\public\public~1\cqgnet\temp\*.*
>> > del c:\users\public\public~1\cqgnet\private\bourtov.*
>> >
>> > I have tried to no avail to convert this to a script. Any help would
>> > be
>> > deeply appreciated as I would learn a lot if I saw it in script.
>> >
>> > Thank you ... Sam
>>
>>
>>


Re: Scripts in Vista
Trying to Learn 5/3/2007 1:48:02 PM
Hi again,

Sorry, I tried using the full name but it has a space in it "public
documents". I don't know how to get around it.

Thanks again ... Sam

"CreateWindow" wrote:

[Quoted Text]
> Hi,
>
> That was probably not right.
> What about specifying the full name?
>
> CreateWindow
>
>
>
> "Trying to Learn" <TryingtoLearn[ at ]discussions.microsoft.com> wrote in message
> news:AE02C341-B21D-41C7-ACBC-DC8BCB3A62E9[ at ]microsoft.com...
> > Thanks for your response. I am still having a problem, but have a
> > question.
> >
> > When I typed the path to the files I want to delete I used a sub directory
> > called public~1. If I typed the complete name it would have been ...
> > public
> > documents. The problem is that I have 4 other sub directories starting
> > with
> > public.
> >
> > In Vista I have .....
> >
> > Public Documents (what I need to path to)
> > Public Downloads
> > Public Music
> > Public Pictures
> > Public Videos
> >
> > That is why I used public~1 (I tried 2,3,4,5 also with no luck)
> >
> > Was that right?
> >
> >
> > "CreateWindow" wrote:
> >
> >> Hi,
> >>
> >> Something like this should work.
> >>
> >> delstr1 = "cmd /c del c:\users\public\public~1\cqgnet\temp\*.*"
> >> delstr2 = "cmd /c del c:\users\public\public~1\cqgnet\private\bourtov.*"
> >>
> >> Set WshShell = WScript.CreateObject("WScript.Shell")
> >> ExitCode = WshShell.Run(delstr1, 10, TRUE )
> >> ExitCode = WshShell.Run(delstr2, 10, TRUE )
> >> Set WshShell = Nothing
> >>
> >> You can test the ExitCode if you like. I think the above is ok - anyway
> >> it
> >> will get you started.
> >>
> >> CreateWindow
> >> http://justpageprobe.com
> >> The FREE Web page utility you always wanted.
> >> Keep your router connected.
> >> Email your IP to where you need it.
> >> Monitor your enterprise Web Servers.
> >>
> >>
> >> "Trying to Learn" <Trying to Learn[ at ]discussions.microsoft.com> wrote in
> >> message news:7CA962B7-EC33-422E-B4FF-E83A84760728[ at ]microsoft.com...
> >> > Hi,
> >> >
> >> > I was trying to write a simple batch file in Vista, and discovered that
> >> > I
> >> > need to do these tasks in the form of a script. I have no experience
> >> > with
> >> > scripts. I felt pretty fortunate that I could get things done using
> >> > batch
> >> > files. I'm an old DOS guy. This is the task I need automated .....
> >> >
> >> > del c:\users\public\public~1\cqgnet\temp\*.*
> >> > del c:\users\public\public~1\cqgnet\private\bourtov.*
> >> >
> >> > I have tried to no avail to convert this to a script. Any help would
> >> > be
> >> > deeply appreciated as I would learn a lot if I saw it in script.
> >> >
> >> > Thank you ... Sam
> >>
> >>
> >>
>
>
>
Re: Scripts in Vista
"CreateWindow" <createwindow[ at ]gmail.com> 5/4/2007 1:23:35 AM
Ok,

Yes, that can be tricky using cmd /c etc. An easy way out is to make a .cmd
or .bat file called test.bat
Then you can quote the string like this -
dir "C:\documents and settings\administrator\local settings\temp" > fred.txt
(just for example - that's puts the dir listing in a file called fred.txt)
and put that sort of line in the bat file.
then the run command is just -
WshShell.Run("test.bat", 10, TRUE )
For deleting *.* you need the /Q for quiet mode like del /q
"Users\public........ etc.

That should help.

Cheers,
CreateWindow
http://justpageprobe.com
The FREE Web page utility you always wanted.
Keep your router connected.
Email your IP to where you need it.
Monitor your enterprise Web Servers.



"Trying to Learn" <TryingtoLearn[ at ]discussions.microsoft.com> wrote in message
news:EE0B8DC1-708A-4885-8304-BE5AC50ABA6E[ at ]microsoft.com...
[Quoted Text]
> Hi again,
>
> Sorry, I tried using the full name but it has a space in it "public
> documents". I don't know how to get around it.
>
> Thanks again ... Sam
>
> "CreateWindow" wrote:
>
>> Hi,
>>
>> That was probably not right.
>> What about specifying the full name?
>>
>> CreateWindow
>>
>>
>>
>> "Trying to Learn" <TryingtoLearn[ at ]discussions.microsoft.com> wrote in
>> message
>> news:AE02C341-B21D-41C7-ACBC-DC8BCB3A62E9[ at ]microsoft.com...
>> > Thanks for your response. I am still having a problem, but have a
>> > question.
>> >
>> > When I typed the path to the files I want to delete I used a sub
>> > directory
>> > called public~1. If I typed the complete name it would have been ...
>> > public
>> > documents. The problem is that I have 4 other sub directories starting
>> > with
>> > public.
>> >
>> > In Vista I have .....
>> >
>> > Public Documents (what I need to path to)
>> > Public Downloads
>> > Public Music
>> > Public Pictures
>> > Public Videos
>> >
>> > That is why I used public~1 (I tried 2,3,4,5 also with no luck)
>> >
>> > Was that right?
>> >
>> >
>> > "CreateWindow" wrote:
>> >
>> >> Hi,
>> >>
>> >> Something like this should work.
>> >>
>> >> delstr1 = "cmd /c del c:\users\public\public~1\cqgnet\temp\*.*"
>> >> delstr2 = "cmd /c del
>> >> c:\users\public\public~1\cqgnet\private\bourtov.*"
>> >>
>> >> Set WshShell = WScript.CreateObject("WScript.Shell")
>> >> ExitCode = WshShell.Run(delstr1, 10, TRUE )
>> >> ExitCode = WshShell.Run(delstr2, 10, TRUE )
>> >> Set WshShell = Nothing
>> >>
>> >> You can test the ExitCode if you like. I think the above is ok -
>> >> anyway
>> >> it
>> >> will get you started.
>> >>
>> >> CreateWindow
>> >> http://justpageprobe.com
>> >> The FREE Web page utility you always wanted.
>> >> Keep your router connected.
>> >> Email your IP to where you need it.
>> >> Monitor your enterprise Web Servers.
>> >>
>> >>
>> >> "Trying to Learn" <Trying to Learn[ at ]discussions.microsoft.com> wrote in
>> >> message news:7CA962B7-EC33-422E-B4FF-E83A84760728[ at ]microsoft.com...
>> >> > Hi,
>> >> >
>> >> > I was trying to write a simple batch file in Vista, and discovered
>> >> > that
>> >> > I
>> >> > need to do these tasks in the form of a script. I have no
>> >> > experience
>> >> > with
>> >> > scripts. I felt pretty fortunate that I could get things done using
>> >> > batch
>> >> > files. I'm an old DOS guy. This is the task I need automated .....
>> >> >
>> >> > del c:\users\public\public~1\cqgnet\temp\*.*
>> >> > del c:\users\public\public~1\cqgnet\private\bourtov.*
>> >> >
>> >> > I have tried to no avail to convert this to a script. Any help
>> >> > would
>> >> > be
>> >> > deeply appreciated as I would learn a lot if I saw it in script.
>> >> >
>> >> > Thank you ... Sam
>> >>
>> >>
>> >>
>>
>>
>>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen