Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Setting the window icon for a command prompt window

30 Jan 2015   #11

Windows 7 Ultimate x64

Quote   Quote: Originally Posted by Pyprohly View Post
Swiftie, you are a genius
Thomas Edison said "Genius is one per cent inspiration, ninety-nine per cent perspiration."

I just happen to be good at the "perspiration" aspect. I can't let go of a problem. It's why I'm sitting at my PC at 05:45 in the morning, having woken up at 04:50 wondering about backups...

My System SpecsSystem Spec
30 Jan 2015   #12

Windows 7 Ultimate x64

Thank you for helping me with my VBS script!

But, there's still work to be done.

My test shortcut was "C:\Users\Steve\Desktop\Split Test.lnk" and the line "objShell.Run strCommand,1" gave me a popup "The system cannot find the file specified".

Obviously, the classic "Filename containing a blank problem".
Renaming the shortcut to C:\Users\Steve\Desktop\Split_Test.lnk and modifying my "split_run.vbs" is a bypass, but now I find myself looking for a way to modify:

objShell.Run strCommand,1

... for the case where strCommand contains blanks.

This is just cosmetic nitpicking though, especially in the case where the underlying program ("split.rex" in my case) just needs to be run as a scheduled task. You can create the vbs "launcher" shortcut anywhere you like, so you won't have to look at an icon with a name of "Split_Test" (from the file "Split_Test.lnk").

If you really want to have an icon that you actually click, then you can create another shortcut, named whatever you like.
My System SpecsSystem Spec
30 Jan 2015   #13

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan

Quote   Quote: Originally Posted by swiftie View Post
Obviously, the classic "Filename containing a blank problem".
Yeah. I tend to forget that paths can have spaces.

A small edit fixes the problem:

Dim strCommand, objShell
strCommand = """C:\Location\to\some script.rex.lnk"""
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand,1

PS: How's the thread at Rexx Forums doing? :)
My System SpecsSystem Spec


 Setting the window icon for a command prompt window

Thread Tools

Similar help and support threads
Thread Forum
Command Prompt has no window
When I run Command prompt from accessories (using a shortcut) I see cmd.exe as a process using task manager. However it does not appear under the application tab and there is no window. Cmd.exe will run ok directly from c:\windows\system32\cmd.exe or pressing the windows key and typing cmd.exe...
General Discussion
Installation stuck with a command prompt window
Hi, I'm having an installation problem. I've previously done an installation of windows7 on my PC with no problems. However, I decided to reinstall windows when my PC was having some issues. I've chosen the 'upgrade' option when reinstalling windows. The problem came when I got a BSOD midway...
Installation & Setup
taskeng.exe opening in a Command Prompt window
Just now, I was reading posts here when a Command Prompt (black) windows opened, titled taskeng.exe. This is the Task Scheduler, right? Why is it opening a Command Prompt window, never did this before. I noticed The Windows update icon is now in the System area of the TaskBar, so I suspect it...
Windows Updates & Activation
Window and Text size in Command Prompt, Windows XP Mode
Anybody know how to change the text size in Windows XP Mode at the command prompt? I've tried right clicking on the DOS shortcut that I set up and changing it there, but it doesn't do anything. Also, I've set it to Full Screen, but everytime I execute a program, it shrinks to a smaller window....
Command Prompt From Explorer Window
How do I open a command prompt from an Explorer Window? Of course it must open at the same path without having to type in navigation commands (that's the whole point). Thanks, Jon
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 19:11.
Twitter Facebook Google+